Decision Optimization

Decision Optimization

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

 View Only
  • 1.  dll missing in path error while running OPL - java examples

    Posted Thu November 18, 2010 06:09 PM

    Originally posted by: bengu


    Hi All,

    I tried running the cuttingStock example with OPL-java code and getting the following error,

    Native code library failed to load: ensure the appropriate library (opl<VERSION>.dll/.so) is in your path.
    Exception in thread "main" java.lang.ExceptionInInitializerError
    at ilog.concert.cppimpl.concert_wrap.setDebugWrappers(concert_wrap.java:34)
    at ilog.opl.IloOplFactory.setDebugMode(IloOplFactory.java:152)
    at cutstock.Cutstock.main(Cutstock.java:26)
    Caused by: java.lang.RuntimeException: Native code library failed to load: ensure the appropriate library (opl<VERSION>.dll/.so) is in your path.
    at ilog.concert.IloJNILoader.loadJNI(IloJNILoader.java:79)
    at ilog.concert.cppimpl.concert_wrapJNI.<clinit>(concert_wrapJNI.java:15)
    ... 3 more

    I do have -Djava.library.path=C:\ILOG\CPLEX_Studio_AcademicResearch122\opl\bin\x64_win64 and path variable also set to C:\ILOG\CPLEX_Studio_AcademicResearch122\opl\bin\x64_win64. However, Iam still getting the error. Pls note that this is an academic license (not sure whether that would make a difference ).

    Thanks for help.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: dll missing in path error while running OPL - java examples

    Posted Fri November 19, 2010 02:49 PM

    Originally posted by: SystemAdmin


    Can you check that the PATH environment variable includes C:\ILOG\CPLEX_Studio_AcademicResearch122\opl\bin\x64_win64?
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: dll missing in path error while running OPL - java examples

    Posted Fri November 19, 2010 03:30 PM

    Originally posted by: SystemAdmin


    Hi,

    Please ignore my previous message, I missed that you already made sure that the bin directory is in the PATH.
    I can't reproduce the error you're reporting.
    Can you try to launch the sample with the following command?
    ant -verbose
    


    Here is the output I have:
    [java] Executing 'C:\Java\IBM\Java50\jre\bin\java.exe' with arguments:
         [java] '-Djava.library.path=../../../../bin/x64_win64'
         [java] '-classpath'
         [java] 'C:\ILOG\CPLEX_Studio_AcademicResearch122\opl\examples\opl_interfaces\java\cutstock\classes;C:\ILOG\CPLEX_Studio_AcademicResearch122\opl\lib\oplall.jar'
         [java] 'cutstock.Cutstock'
         [java]
         [java] The ' characters around the executable and arguments are
         [java] not part of the command.
         [java] Setting environment variable: PATH=C:\ILOG\CPLEX_Studio_AcademicResearch122\opl\bin\x64_win64;C:\ILOG\CPLEX_Studio_AcademicResearch122\opl\examples\opl_interfaces\java\cutstock\${env.PATH}
         [java] Setting environment variable: LD_LIBRARY_PATH=C:\ILOG\CPLEX_Studio_AcademicResearch122\opl\bin\x64_win64
         [java] OPL - Development Mode. Use IloOplFactory.setDebugMode(false) to switch to production mode.
         [java] Solve master.
         [java] OBJECTIVE: 125.0
         [java] Solve sub.
         [java] OBJECTIVE: -4.0
    [...]
    

    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: dll missing in path error while running OPL - java examples

    Posted Fri November 19, 2010 04:35 PM

    Originally posted by: SystemAdmin


    It could be that bengu is using a 32-bit JRE instead of 64-bit.

    Error about not finding shared library can be sometimes mis-leading because the real issue might be that dependent libraries could not be found.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: dll missing in path error while running OPL - java examples

    Posted Fri November 19, 2010 04:40 PM

    Originally posted by: bengu


    Yes Sir. You caught me.

    I am using netbeans and I did n't recognize that its pointing to 32bit JRE rather than 64 bit JRE. With the correct JRE (64-bit), the issue is resolved.

    Thanks alot.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer