Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
  • 1.  I am new but I need your help, eclipse file path

    Posted Sat May 08, 2010 04:16 PM

    Originally posted by: Lamber


    I use eclipse to test an CPLEX file, which pop up the error information as:

    java.lang.UnsatisfiedLinkError: no cplex102 in java.library.path
    java.library.path must point to the directory containing the CPLEX shared library
    try invoking java with java -Djava.library.path=...
    Exception in thread "main" java.lang.UnsatisfiedLinkError: ilog.cplex.Cplex.CPXopenCPLEX([I)J
    at ilog.cplex.Cplex.CPXopenCPLEX(Native Method)
    at ilog.cplex.CplexI.init(CplexI.java:4684)
    at ilog.cplex.CplexI.<init>(CplexI.java:453)
    at ilog.cplex.IloCplex.<init>(IloCplex.java:7598)
    at test1.main(test1.java:19)
    Where can I set the library path, how to find those library?

    Thank you very much!
    #DecisionOptimization
    #MathematicalProgramming-General


  • 2.  Re: I am new but I need your help, eclipse file path

    Posted Sat May 08, 2010 06:16 PM

    Originally posted by: SystemAdmin


    The first step is to register the CPLEX library with Eclipse. You may already have done part of this, but just to be safe I'll go through the whole process.

    Go to Window > Preferences > Java > Build Path > User Libraries and click New. Give an appropriate name (e.g., CPLEX 10.2) and leave the system library box unchecked. Now click Add JARs, navigate to the cplex.jar file, and select it. Now highlight the cplex.jar entry and expand it. Select Javadoc location and browse for the correct directory. With CPLEX 12.1 (in the US) it's .../cplex121/doc/html/en-US/refjavacplex/html, but your mileage may vary. Once you've located the Javadoc, select Native library location and browse to where the libraries are located. The locations are platform specific (somewhere in the CPLEX installation tree, of course), but the path will be under the CPLEX bin directory, in a folder whose name designates your hardware platform (likely x86_... if you're a PC user). The folder will contain .dll files if you're on Windows, a shared library file (.so) and some executables on Linux, etc. Once you've got the library setting correct, click Ok to get out of the dialog.

    Now right click your project in the project navigator, select Build Path > Add Libraries > User Library, and add the CPLEX library. (You may already have done this, since you seem to be able to compile your application.) The user library entry will now provide both the path to cplex.jar (for compilation) and the path to the libraries (for execution).

    /Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #DecisionOptimization
    #MathematicalProgramming-General


  • 3.  Re: I am new but I need your help, eclipse file path

    Posted Sun May 16, 2010 10:20 PM

    Originally posted by: Lamber1


    Thank you professor, I fix the problem. even though the doc files is not available to me.

    Can you give me any examples in Cplex Java? I need to practice more! I am a PhD student in IE~
    #DecisionOptimization
    #MathematicalProgramming-General


  • 4.  Re: I am new but I need your help, eclipse file path

    Posted Mon May 17, 2010 11:01 AM

    Originally posted by: SystemAdmin


    > Lamber1 wrote:
    > Thank you professor, I fix the problem. even though the doc files is not available to me.
    >
    > Can you give me any examples in Cplex Java? I need to practice more! I am a PhD student in IE~

    There are 41 example files that come with CPLEX. Your installation should have a folder named "examples", parallel to the "bin" folder. From there, drill down to examples/src/java.

    I'm afraid that the only code I have is quite complicated, so it would be unsuitable for someone learning to use CPLEX with Java.

    /Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #DecisionOptimization
    #MathematicalProgramming-General