# CPLEX column generation example in Java - compilation error

 0 I am trying to compile the column generation example cutstock.java that comes along the IBM ILOG technology. The code is available here: https://www.ibm.com/support/knowledgecenter/SSSA5P_12.6.1/ilog.odms.ide.help/examples/html/opl_interfaces/java/cutstock/src/cutstock/Cutstock.java.html  In my installation, all sources of this example are in directory /opt/ibm/ILOG/CPLEX_Studio1251/opl/examples/opl_interfaces/java/cutstock  I copy the entire directory with the source files to my working directory and use the following command to compile it: javac -cp /opt/ibm/ILOG/CPLEX_Studio1251/cplex/lib/cplex.jar:/opt/ibm/ILOG/CPLEX_Studio1251/opl/lib/oplall.jar:. src/cutstock/Cutstock.java -d bin/ -Xdiags:verbose  I get the following error messages: rc/cutstock/Cutstock.java:85: error: method getDual in class IloCplex cannot be applied to given types; duals.set(i, masterCplex.getDual(forAll)); ^ required: IloRange found: IloForAllRange reason: argument mismatch; IloForAllRange cannot be converted to IloRange src/cutstock/Cutstock.java:105: error: cannot find symbol IloIntMap newFill = masterCplex.intMap(items); ^ symbol: method intMap(IloIntRange) location: variable masterCplex of type IloCplex 2 errors  I haven't made any changes in the example, so I expected it to work normally. I am new to the Concert technology and would like to learn how to develop a column generation procedure. Can anyone please suggest how to fix these errors and successfully compile the code? asked 21 Apr '18, 11:35 Marika 13●2 accept rate: 0%

 0 I haven't tried this, but looking at the build_common.xml file (for CPLEX 12.8 -- I don't have 12.5.1 installed anymore), I see a reference to oplall.jar but no reference to cplex.jar. What happens if you either omit cplex.jar from the class path or move it after oplall.jar? I wonder if there are some methods defined in both jar files, with the compiler grabbing the version in cplex.jar when it should be using the one in oplall.jar. answered 21 Apr '18, 13:46 Paul Rubin ♦♦ 14.6k●4●12 accept rate: 19% Thank you so much! It seems like there was a conflict between the two jars. Your suggestion helped and after removing cplex.jar from the classpath, the compilation run through without any problems. (21 Apr '18, 19:44) Marika
 toggle preview community wiki

### Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "Title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

Tags:

×191
×21
×18

Asked: 21 Apr '18, 11:35

Seen: 147 times

Last updated: 21 Apr '18, 19:44

### Related questions

OR-Exchange! Your site for questions, answers, and announcements about operations research.