Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  UnsatisfiedLinkError: no cplex125 in java.library.path

    Posted 12/01/14 10:25 AM

    Originally posted by: Manos88


    Hello,

    I have written a java application in a windows 32bit machine using cplex and I want to create a jar file that will be able to execute at any machine. I created a "fat" jar which contains all external libraries, but when I try to execute on a linux machine I get the following error:

    java.lang.UnsatisfiedLinkError: no cplex125 in java.library.path
    java.library.path must point to the directory containing the CPLEX shared library

    Is there anything I can do so as to include in the jar everything that is needed for the application to run, or do I have to install cplex at every machine that I need to use it and point to the path?

    Thanks!


     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: UnsatisfiedLinkError: no cplex125 in java.library.path

    Posted 12/03/14 07:27 PM

    The CPLEX Java API is a wrapper around the native Callable C library.  Are you saying that you've included cplex125.dll in your jar file on Windows?  And this works if you move your jar file to a Windows machine with no CPLEX installed?  I can't say I've tried this or heard of someone trying this (embedding the .dll file inside of the jar), but it sounds plausible (looks like a question like this was on stackoverflow).  On Linux, you'd need the cplex125.so (shared library) file.  You'd need the equivalent on every platform you want to deploy on.  Even on Windows, you're picking a particular platform (e.g., VS2012 64-bit, VS2013 32-bit, etc.) where it assumes certain C++ runtimes are installed, etc.

    EDIT 1: You can certainly deploy only what is needed for each platform.  It is not required that each machine has a full-blown CPLEX Optimization Studio installed.

    EDIT 2: 12.5 is pretty old at this point.  You might want to upgrade to the most recent version.

    Hope that helps


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: UnsatisfiedLinkError: no cplex125 in java.library.path

    Posted 12/20/14 06:53 AM

    Originally posted by: Manos88


    Hello,

    I tried to use this command in linux:

    java -Djava.library.path= /usr/local/cplex_studio_125/cplex/bin/ -cp /usr/local/cplex_studio_125/cplex/lib/cplex.jar -jar test.jar

    where test.jar is the jar I want to run. But I get the following error: Error: Could not find or load main class .usr.local.cplex_studio_125.cplex.bin.

    Any idea why is that? I've seen in some other topics in this forum that this command should work.

    Thanks!

     


    #CPLEXOptimizers
    #DecisionOptimization