Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Running CPLEX JAVA program on a linux terminal

    Posted Mon April 06, 2020 08:30 AM

    Originally posted by: pmapsp


    Hello,

     

    I'm trying to run a java program on a remote linux machine. This machine doesn't have JAVA JDK installed so my program has to be a .jar file.

     

    Right now I have the cplex.jar file on the same directory as my program.

    Since having the -cp and the -jar command at the same time doesn't work, I have followed this solution here

    My equivalent is this command:  java -Djava.library.path="/home/pmapereira/Cplex/cplex/bin/x86-64_linux" -cp /home/pmapereira/Routing Problem/cplex.jar:App2.jar App

     

    In which the .so files are int the/home/pmapereira/Cplex/cplex/bin/x86-64_linux directory.

    However, I´m getting this error:

     

    Error: Could not find or load main class Problem.cplex.jar:App2.jar

     

    So my main question is how am I able to run a .jar program with CPLEX in a remote machine using the linux terminal?

     

    Thanks.

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Running CPLEX JAVA program on a linux terminal

    Posted Mon April 06, 2020 08:57 AM

    The problem is the blank in your folder name. Try to escape or quote this:

    java -Djava.library.path="/home/pmapereira/Cplex/cplex/bin/x86-64_linux" -cp "/home/pmapereira/Routing Problem/cplex.jar:App2.jar" App


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Running CPLEX JAVA program on a linux terminal

    Posted Mon April 06, 2020 09:07 AM

    Originally posted by: pmapsp


    Thank you!! It worked!

    Thank you for your time!


    #CPLEXOptimizers
    #DecisionOptimization