2016-06-17 250 views
1

我已经阅读了许多论坛,但是我还没有发现IntelliJ Idea的任何内容。如何使用CPLEX配置IntelliJ Idea

我不是开发者,但是我在Debian上管理了一个Tomcat8服务器。

开发人员希望在其Grails应用程序中使用IBM ILOG CPLEX。他使用IDE“IntelliJ Idea”。 他将使它通过这样创建对象的工作:

// Create the shape/object solver 
      IloCplex CPLEX IloCplex = new(); 
      System.out.println ("\ n IloCplex CPLEX IloCplex = new();"); 
     ... 
     ... 

的PC用户是Windows和IntelliJ IDEA的和CPLEX安装。 有了这个配置程序的作品。

当程序导出.war并传输到tomcat服务器时,它不再起作用。

我们有错误:

Error 500: Internal Server Error 

    line | method 
- 1145 >> | runWorker in java.util.concurrent.ThreadPoolExecutor 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 615 | run in java.util.concurrent.ThreadPoolExecutor $ Worker 
^ 745 | run. . . in java.lang.Thread 

Caused by ControllerExecutionException: Runtime error executing actions 
- 1145 >> | runWorker in java.util.concurrent.ThreadPoolExecutor 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 615 | run in java.util.concurrent.ThreadPoolExecutor $ Worker 
^ 745 | run. . . in java.lang.Thread 

Caused by InvocationTargetException: null 
- 1145 >> | runWorker in java.util.concurrent.ThreadPoolExecutor 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 615 | run in java.util.concurrent.ThreadPoolExecutor $ Worker 
^ 745 | run. . . in java.lang.Thread 

Caused by UnsatisfiedLinkError: ilog.cplex.Cplex.CPXopenCPLEX ([I) J 
- 6594 >> | init in ilog.cplex.CplexI 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
| 629 | <Init> in ' 
| 11067 | <Init>. ilog.cplex.IloCplex in 
| 11082 | <Init> in ' 
| 93 | save. . agriplan.APProjectController in 
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor 
| 615 | run. . . java.util.concurrent.ThreadPoolExecutor $ Worker in 
^ 745 | run in java.lang.Thread 

开发商告诉我这是从线IloCplex CPLEX IloCplex =新(); 它不起作用。

我想这个问题是没有找到CPLEX 的程序,所以我加CPLEX的路径Grails的选项“VM选项”:

-Djava.library.path =/Opt/IBM/ILOG/CPLEX_Studio126/CPLEX/bin/x86-64_linux 

但我有同样的错误

的用户没有忘记在程序库中实现cplex.jar

问题是在服务器端还是在应用程序中?他在IntelliJ Idea的其他地方有什么话要说吗?

我们应该在IntelliJ Idea中声明其他东西吗?

非常感谢你

+0

这个问题是跨贴在[此处](https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014468725)(在IBM developerWorks论坛)。 – rkersh

回答

0

做,如果你运行随CPLEX java的例子,你得到同样的错误?为了验证这一点,你可以做以下(假设你的路径的正确上面):

$ cd /Opt/IBM/ILOG/CPLEX_Studio126/CPLEX/examples/x86-64_linux/static_pic 
$ make execute_java 2>&1 | tee output.txt 

这将保存在output.txt的输出,使你可以看看它后面。它应该让你知道所需的命令行参数是什么。

例如,我的系统上,我看到这个output.txt中的其中一个例子:

java -d64 -Djava.library.path=../../../bin/x86-64_linux -classpath ../../../lib/cplex.jar: LPex3 

你们中许多人只需要添加-d64-classpath(用正确的路径)到您的“VM选项“部分(我没有使用IntelliJ,但”VM选项“听起来很合理)。

最后,看到Configuring the Eclipse Java IDE to use CPLEX libraries(IBM的技术说明,应该给你什么在一个IDE需要的是一个好主意)。