I am using Java to solve a series of problems with Cplex. My main goad is to optimise different stances of a model with modified variables and constraints ( and no, I can't modify the main model every time). To do so, I want to use IloEnv, but, this command:
is not recognised by Cplex. It gives me the "IloEnv cannot be resolved to a type" error.
<a href="https://www.ibm.com/support/knowledgecenter/SSSA5P_12.8.0/ilog.odms.cplex.help/refcppcplex/html/classes/IloEnv.html" rel="nofollow">IloEnv</a> is only available in the <a href="https://www.ibm.com/support/knowledgecenter/SSSA5P_12.8.0/ilog.odms.cplex.help/refcppcplex/html/overview.html" rel="nofollow">C++ API</a>, but not the <a href="https://www.ibm.com/support/knowledgecenter/SSSA5P_12.8.0/ilog.odms.cplex.help/refjavacplex/html/overview-summary.html" rel="nofollow">Java API</a> (where the memory management details are hidden).
With the Java API, you can just create an <a href="https://www.ibm.com/support/knowledgecenter/SSSA5P_12.8.0/ilog.odms.cplex.help/refjavacplex/html/ilog/cplex/IloCplex.html" rel="nofollow">IloCplex</a> for each instance of your model.
It would be well worth your time to look at the <a href="https://www.ibm.com/support/knowledgecenter/SSSA5P_12.8.0/ilog.odms.cplex.help/CPLEX/homepages/examplescplex.html" rel="nofollow">examples</a> that are shipped with CPLEX Optimization Studio. If
COSDIR is the location where you installed the product, then the examples can be found at