Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

Ensure the appropriate library (opl1260.dll/.so) is in your path

  • 1.  Ensure the appropriate library (opl1260.dll/.so) is in your path

    Posted Sat August 31, 2019 04:08 AM

    Originally posted by: Saumya_Bhatnagar


    Hi,

    I am using CPLEX 12.7.0 with Java on Mac OS. I use cplex.jar and ILOG.CP.jar in my application. My application works fine when I run it in Eclipse IDE, but when I try to run it as a .jar file, I get the following error:

     

    No version in manifest (not in a jar?), trying 1260

    No version in manifest (not in a jar?), trying 1260

    Native code library failed to load: ensure the appropriate library (opl1260.dll/.so) is in your path.

    Exceptions:

    no opl1260 in java.library.path

     

    The command I use to run the .jar file is:

    java -Djava.library.path=/Applications/IBM/ILOG/CPLEX_Studio127/cpoptimizer/bin/x86-64_osx:/Applications/IBM/ILOG/CPLEX_Studio127/cplex/bin/x86-64_osx -jar <name_of_jar_file>.jar <list_of_arguments>

     

    Tried the solution discussed in https://www.ibm.com/developerworks/community/forums/html/topic?id=1c41783f-d0c2-4666-b0ed-ddd172843a30, which did not work. The error seems a bit confusing since there is no opl folder in the CPLEX distribution for Mac OSX.

    Any pointers on how to resolve this would be of great help. Thanks.

     

     

     


    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: Ensure the appropriate library (opl1260.dll/.so) is in your path

    Posted Tue September 03, 2019 04:24 AM

    Originally posted by: Petr Vilím


    Hello,

    I believe the issue is that only java.library.path is set and not DYLD_LIBRARY_PATH. My understanding is that Java looks for libraries in java.library.path. However if that library needs another sub-library then the sub-library is loaded by operation system. And operation system does not know about java.library.path, it knows only DYLD_LIBRARY_PATH. As the result the parent library is not loaded and misleading error message is printed by java library wrapper. At least that's my guess.

    You may have a look at examples/x86-64_osx/static_pic/Makefile how exactly Java examples are executed and copy the code from there. The Makefile is using DYLD_LIBRARY_PATH.

    Best regards, Petr


    #CPOptimizer
    #DecisionOptimization


  • 3.  Re: Ensure the appropriate library (opl1260.dll/.so) is in your path

    Posted Thu September 05, 2019 09:20 AM

    Originally posted by: Saumya_Bhatnagar


    Hi Petr,

    Thanks for your response. Indeed, setting the DYLD_LIBRARY_PATH before invoking the java -jar command works:

    DYLD_LIBRARY_PATH=/Applications/IBM/ILOG/CPLEX_Studio127/cpoptimizer/bin/x86-64_osx:/Applications/IBM/ILOG/CPLEX_Studio127/cplex/bin/x86-64_osx java -Djava.library.path=/Applications/IBM/ILOG/CPLEX_Studio127/cpoptimizer/bin/x86-64_osx:/Applications/IBM/ILOG/CPLEX_Studio127/cplex/bin/x86-64_osx -classpath lib/*. -jar <name_of_jar_file>.jar <list_of_arguments>
    

     


    #CPOptimizer
    #DecisionOptimization