【问题标题】:How to configure IntelliJ Idea with CPLEX如何使用 CPLEX 配置 IntelliJ Idea
【发布时间】:2016-06-17 10:26:48
【问题描述】:

我已经阅读了很多论坛,但我没有找到任何关于 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 = new (); 它不起作用。

我猜问题是找不到 CPLEX 的程序 所以我在 Grails Options "VM options" 中添加了 CPLEX 的路径:

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

但我有同样的错误

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

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

我们是否应该在 IntelliJ Idea 中声明其他内容?

非常感谢

【问题讨论】:

    标签: java grails intellij-idea tomcat8 cplex


    【解决方案1】:

    如果您运行 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 中的要求)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-04-21
      • 2019-05-02
      • 1970-01-01
      • 2013-07-10
      • 2019-01-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多