# Should @objective be replaced by @NLobjective in JuMP documentation?

**URL:** <https://discourse.julialang.org/t/should-objective-be-replaced-by-nlobjective-in-jump-documentation/113500>\
**Category:** Optimization (Mathematical)\
**Tags:** question, documentation, jump\
**Created:** [April 25, 2024, 1:43pm UTC](https://discourse.julialang.org/t/should-objective-be-replaced-by-nlobjective-in-jump-documentation/113500 "2024-04-25T13:43:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dnldlg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnldlg/32/209465_2.png) [@dnldlg](https://discourse.julialang.org/u/dnldlg)\
**Post date:** [April 25, 2024, 1:43pm UTC](https://discourse.julialang.org/t/should-objective-be-replaced-by-nlobjective-in-jump-documentation/113500/1 "2024-04-25T13:43:28Z")

</div>

Hello,

I’m currently reading the introductory section of the JuMP documentation and observed in the [examples for the non-linear problems](https://jump.dev/JuMP.jl/stable/tutorials/nonlinear/simple_examples/#), that the macros `@objective` and `@constraints` are used. If I run these examples I get an error message with the statement

> Are you trying to build a nonlinear problem? Make sure you use @NLconstraint/@NLobjective.

Should the macros in the example be replaced by their NL-counterparts `@NLconstraint` and `@NLobjective`?

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [April 26, 2024, 8:00am UTC](https://discourse.julialang.org/t/should-objective-be-replaced-by-nlobjective-in-jump-documentation/113500/2 "2024-04-26T08:00:10Z")

</div>

Hi @dnldlg,

You’re probably using an older version of JuMP that doesn’t support the updated nonlinear syntax.

You should either update to the latest version of JuMP, or consult the documentation for the version you are using.

There is a version selector in the bottom-left of the documentation page:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/6/f/6fcb75d9e896d3081cef1afbb043880dc5627898.png)

---

<div class="post-metadata">

**Author:** ![dnldlg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnldlg/32/209465_2.png) [@dnldlg](https://discourse.julialang.org/u/dnldlg)\
**Post date:** [May 21, 2024, 3:45pm UTC](https://discourse.julialang.org/t/should-objective-be-replaced-by-nlobjective-in-jump-documentation/113500/3 "2024-05-21T15:45:49Z")

</div>

Thank you, that was indeed the issue. As I was not using the newest Julia version, my downloaded package was not v1.21.
