Decision Optimization

Decision Optimization

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

 View Only
  • 1.  cpoptimizer java : SwigDirector_IloIntValueEvalWrapper_eval

    Posted Wed December 17, 2014 09:48 AM

    Originally posted by: Marc Brisson


    Hi this is the first time I try to run cpoptimizer SchedIntro example in a Java  project  (12.6, Windows 8.1, IntelliJ )

    I created a simple Java project with a reference to ILOG.CP.jar.

    C:\ILOG\CPLEX_Studio126\cpoptimizer\bin\x64_win64 is in my path

    echo %PATH%

    C:\ProgramData\Oracle\Java\javapath;C:\ILOG\CPLEX_Studio126\opl\bin\x64_win64;C:\ILOG\CPLEX_Studio126\opl\oplide\;C:\ILOG\CPLEX_Studio126\cplex\bin\x64_win64;C:\ILOG\CPLEX_Studio126\cpoptimizer\bin\x64_win64; ....

    the code compiles but when I run it. I get the error :

    when creating  a IloCP

    IloCP cp = new IloCP();

    Exception in thread "main" java.lang.NoSuchMethodError: SwigDirector_IloIntValueEvalWrapper_eval
        at ilog.cp.cppimpl.cp_wrapJNI.swig_module_init(Native Method)
        at ilog.cp.cppimpl.cp_wrapJNI.<clinit>(cp_wrapJNI.java:536)
        at ilog.cp.cppimpl.IloCP.<init>(IloCP.java:109)
        at ilog.cp.IloCP.<init>(IloCP.java:125)
        at ilog.cp.IloCP.<init>(IloCP.java:117)
        at com.jda.Main.main(Main.java:11)
     

    Any one has an Idea?

     

    thanks

     

     

     


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: cpoptimizer java : SwigDirector_IloIntValueEvalWrapper_eval

    Posted Thu December 18, 2014 06:12 AM

    Originally posted by: Olivier OUDOT


    Hello Marc,

    Your problem seems related to the installation of the product, with a possible relation with a previous version of CPLEX studio on your machine. A first recommandation would be to re-install the product, using all default settings.

    Otherwise, to execute CPO from Java, you need to have access to the following three files:

     - cplex1260.dll (in C:\Program Files\IBM\ILOG\CPLEX_Studio126\cplex\bin\x64_win64)
     - cp_wrap_cpp_java1260.dll  (in C:\Program Files\IBM\ILOG\CPLEX_Studio126\cpoptimizer\bin\x64_win64)
     - ILOG.CP.jar (in C:\Program Files\IBM\ILOG\CPLEX_Studio126\cpoptimizer\lib)

    Please ensure that all these files are in your system path or classpath (for the jar).

    In case of doubt, you can copy them in a separate directory that you add to your path. 

    Hope this helps, and please keep me informed.


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 3.  Re: cpoptimizer java : SwigDirector_IloIntValueEvalWrapper_eval

    Posted Wed March 28, 2018 06:06 PM

    Originally posted by: Farouk HAMMAMI


    Hello Olivier,

     

    Can you help me please with this issue?

    https://www.ibm.com/developerworks/community/forums/html/topic?id=8535c6c2-458e-49b1-8731-388096e3d8bf

     

    Thank you


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 4.  Re: cpoptimizer java : SwigDirector_IloIntValueEvalWrapper_eval

    Posted Fri March 30, 2018 09:19 AM


  • 5.  Re: cpoptimizer java : SwigDirector_IloIntValueEvalWrapper_eval

    Posted Sat July 04, 2015 05:40 AM

    Originally posted by: Ba-opt


    Hello

    Have you solved the problem?

    I have the same problem now with the same error message. I am using Eclipes 4.2.1 and cplex 12.6.1.

    I have re-installed the product and removed the old setting. I also tried to copy the three files and put them  under java project file (the same as Java class file), but still have the same problem.

    What is the reason? Can you please give some advice?

     

    Regards


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 6.  Re: cpoptimizer java : SwigDirector_IloIntValueEvalWrapper_eval

    Posted Sat July 04, 2015 03:55 PM

    Originally posted by: Marc Brisson


    This was the answer I received from IBM SUPPORT: Your system PATH is not correct.  It should only reference
    the cpoptimizer bin directory, and the cplex bin directory.
    It should not refer to the opl bin directory (the libraries
    in opl bin are close, but not the same, and will give NoSuchMethodErrors).

     


    Please remove the two opl references from your path,
    and try again.

     

     

    I hope it helps. For me it worked.


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 7.  Re: cpoptimizer java : SwigDirector_IloIntValueEvalWrapper_eval

    Posted Sat July 04, 2015 10:51 PM

    Originally posted by: Ba-opt


    Hello Marc,

    Thanks for the reply. After I removed the path to opl bin, it works. Thanks.

    I have tried the new version, Cplex 1262, and it is the same.
     
    In fact, when it is installed, it will create a variable called  %CPLEX_STUDIO_BINARIES1262%  and it will be added to the path.
    In side of %CPLEX_STUDIO_BINARIES1262%, it has all the pathes to opl, cplex and cpoptimizer like below.


    < C:\Program Files\IBM\ILOG\CPLEX_Studio1262\opl\bin\x64_win64;C:\Program Files\IBM\ILOG\CPLEX_Studio1262\opl\oplide\;C:\Program Files\IBM\ILOG\CPLEX_Studio1262\cplex\bin\x64_win64;C:\Program Files\IBM\ILOG\CPLEX_Studio1262\cpoptimizer\bin\x64_win64  >

    After I remove the "C:\Program Files\IBM\ILOG\CPLEX_Studio1262\opl\bin\x64_win64;" from it , it works now. However, I may have problems if I run some others using some lib under opl\bin.  I think it is a bug and the support guy should report it and fix it.

    Thanks a lot and it helps.


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 8.  Re: cpoptimizer java : SwigDirector_IloIntValueEvalWrapper_eval

    Posted Fri April 27, 2018 09:30 AM

    Originally posted by: Ahlem


    Hi, 

    Please i have the same problem and i remove the two opl references from your path but eclipse shows me the same error : 

    NoSuchMethodError: SwigDirector_IloIntValueEvalWrapper_eval

    Please help me. 

    Thanx you. 

    Regards. 


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 9.  Re: cpoptimizer java : SwigDirector_IloIntValueEvalWrapper_eval

    Posted Mon April 30, 2018 09:07 AM

    Originally posted by: ChrisBr


    Hello,

    Difficult to help you.
    Could you tell us:

    • Which version of CPLEX_Studio are you using?
    • On which OS?
    • What is your path exactly?
    • Have you a special Eclipse project?
    • What ever you think it can help...

    Regards,

    Chris.

     


    #DecisionOptimization
    #OPLusingCPOptimizer


  • 10.  Re: cpoptimizer java : SwigDirector_IloIntValueEvalWrapper_eval

    Posted Wed May 02, 2018 04:15 AM

    Originally posted by: Olivier OUDOT


    Hello Ahlem,

     

    On top of questions from Christiane, I suggest you display explicitly your system path directly from your Java program by adding the following line in your code:

    System.out.println("PATH: " + System.getenv("PATH"));

    (may be on Linux you should also display LD_LIBRARY_PATH)

    Please also check your Eclipse running environment that may have overwriten environment with something wrong (Run > Run Configurations > <your_program> > Environment). By the way, it is also a good place to test different PATH values without changing the system variables.

     

    Hope this helps.


    #DecisionOptimization
    #OPLusingCPOptimizer