You are looking at the example from master
branch from the GitHub repository. There are breaking changes in JuMP API since its last release.
You should look at basic.jl file in your local repository. It should be located in a directory location like ~/.julia/packages/JuMP/Xvn0n/examples/basic.jl
(the Xvn0n
part might be different in your case but the path pattern should be the same; if you are on Windows then ~
is a directory of your user profile).
The example you are referring to looks like this in the released version of the package:
using JuMP, Clp
m = Model(solver = ClpSolver())
@variable(m, 0 <= x <= 2)
@variable(m, 0 <= y <= 30)
@objective(m, Max, 5x + 3y)
@constraint(m, 1x + 5y <= 3.0)
print(m)
status = solve(m)
println("Objective value: ", getobjectivevalue(m))
println("x = ", getvalue(x))
println("y = ", getvalue(y))
You can also find the zipped sources of the latest release here https://github.com/JuliaOpt/JuMP.jl/releases/tag/v0.18.4, but of course as new releases are published the number will change so the most reliable place to look at the codes are examples that JuMP has on your local machine.