2016-06-17 252 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需要的是一個好主意)。