Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  CPLEX on linux terminal (java)

    Posted 06/25/17 11:52 AM

    Originally posted by: ItaiB


    Hello,

     

    I am trying to run a program with cplex on linux server via putty and I get an error because of the cplex.

    (on window the program run well).

     

    Project files:

                       ProjectLinux/src/Main.java , Solver.java

                       ProjectLinux/cplex/cplex.jar , x86-64_linux (native library)

     

    The line on the terminal to run:

                            javac -cp ../cplex/cplex.jar *.java

                            java -cp .:../cplex/x86-64_linux Main

     

    (The program run but get error when cplex used)

     

    The error I get:

     

    java.lang.UnsatisfiedLinkError: no cplex1271 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:6739)
            at ilog.cplex.CplexI.<init>(CplexI.java:746)
            at ilog.cplex.IloCplex.<init>(IloCplex.java:10334)
            at ilog.cplex.IloCplex.<init>(IloCplex.java:10349)
            at Solver.solve(Solver.java:52)
            at Main.main(Main.java:29)

     

    Please if someone know how to solve that problem.

     

    Thanks !


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: CPLEX on linux terminal (java)

    Posted 06/25/17 06:20 PM

    The JAR file is one of two files your application needs to use CPLEX. The other is a runtime file, libcplex1271.so. The line

    try invoking java with java -Djava.library.path=...

    tells you what you need to do. Add -Djava.library.path=<wherever CPLEX Studio is installed on remote machine>/cplex/bin/x86-64_linux/ to your command line (after making sure that the .so file really exists there).

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: CPLEX on linux terminal (java)

    Posted 07/01/17 07:43 AM

    Originally posted by: ItaiB


    Thank you for your answer.

    I use the line:

            export LD_LIBRARY_PATH=../cplex/x86-64_linux

    end it's work !


    #CPLEXOptimizers
    #DecisionOptimization