java如何用CPLEX配置IntelliJ Idea
我读过很多论坛,但我没有找到任何关于IntelliJ Idea的内容
我不是开发人员,但我在Debian上管理Tomcat8服务器
开发人员希望在其Grails应用程序中使用IBMILOGCPLEX。他使用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=new()行; 它不起作用
我想问题是程序找不到CPLEX 因此,我在Grails选项“VM选项”中添加了CPLEX的路径:
-Djava.library.path = / Opt / IBM / ILOG / CPLEX_Studio126 / CPLEX / bin / x86-64_linux
但我也有同样的错误
用户没有忘记实现cplex。程序库中的jar
问题是在服务器端还是在应用程序中? 在IntelliJ Idea的其他地方他有话要说
我们应该在IntelliJ Idea中声明其他内容吗
多谢各位
# 1 楼答案
如果运行CPLEX附带的java示例,会出现同样的错误吗?要测试这一点,您可以执行以下操作(假设您的路径从上面看是正确的):
这将在输出中保存输出。txt,以便稍后查看。它应该让您了解所需的命令行参数是什么
例如,在我的系统上,我在输出中看到了这一点。txt中的一个示例:
许多人只需在“VM选项”部分添加
-d64
和-classpath
(路径正确)(我没有使用IntelliJ,但“VM选项”听起来很合理)最后,请参阅Configuring the Eclipse Java IDE to use CPLEX libraries(一篇IBM技术笔记,它会让您很好地了解IDE中需要什么)