线程“主”中的异常java.lang.UnsatisfiedLinkError:否java.library.path中的GurobiJni56 [英] Exception in thread "main" java.lang.UnsatisfiedLinkError: no GurobiJni56 in java.library.path
问题描述
当我试图运行我的程序时,我遇到了标题中给出的异常。在这里,Gurobi是优化问题的解决者,并从 http://www.gurobi.com/ 下载。奇怪的是,我的计划是在另一天工作,但随后突然停止工作。任何不使用 gurobi。*;
包的任何常规程序运行正常。导入 gurobi。*;
在我的测试程序中也可以正常工作,所以它存在。
Googling错误告诉我找到Gurobi库的路径有问题。有没有人遇到同样的问题,熟悉一个解决方案?正如我所说,我是Java的新手,不知道如何设置偏好。另外,Gurobi常见问题( http://www.gurobi.com/resources/faqs )说为了在OS X上的Eclipse Java项目中使用Gurobi,不需要使用Gurobi Optimizer的默认安装进行任何特殊配置。
如果有人知道如何在OS X上调整这些东西,也可能在OS X上使用Gurobi软件进行Eclipse Java,这将非常有用!
这是我遇到的整个控制台消息运行程序时:
线程main中的异常java.lang.UnsatisfiedLinkError:no java.library.path中的GurobiJni56
在java.lang.ClassLoader.loadLibrary(ClassLoader.java:1764)
在java.lang.Runtime.loadLibrary0(Runtime.java:823)
在java.lang.System.loadLibrary( System.java:1044)
在gurobi.GurobiJni。< clinit>(GurobiJni.java:193)
在gurobi.GRBEnv。< init>(GRBEnv.java:16)
在gurobi.G RBEnv。< init>(GRBEnv.java:11)
在Model.main(Model.java:426)
提前谢谢!如果我提供的信息不足以回答我的问题,请通知我。
Henrik
尝试将包含库libGurobiJni56.jnilib
的目录添加到java.library.path属性。
您可以将它添加到javavm参数中:
-Djava.library.path = / path / to / libGurobiJni55 /
或在eclipse中像这个问题一样:
First of all, I am new to Java programming and please excuse me for any wrong use of terms or for overseeing obvious mistakes. I am using OS X Yosemite on a MacBook Pro, and are coding Java in Eclipse.
I encounter the exception given in the title when I'm trying to run my program. Here, Gurobi is a solver for optimization problems and is downloaded from http://www.gurobi.com/. The weird thing is that my program was working the other day, but then it suddenly ceased to work. Any regular programs that does not use anything from the gurobi.*;
package runs just fine. Importing gurobi.*;
also works fine in my test program, so it exists.
Googling the error tells me there's something wrong with the path for finding the Gurobi library. Has anyone encountered the same problem and is familiar with a solution? As I said, I am new to Java and have no clue how to set up the preferences right. Also, the Gurobi FAQ (http://www.gurobi.com/resources/faqs) says there is no need to do any special configuration with the default installation of Gurobi Optimizer in order to use Gurobi in an Eclipse Java project on OS X.
If anyone know how to adjust these things on OS X and also may have used the Gurobi software for Eclipse Java on OS X, it would have been very helpful!
Here's the whole console message I encounter when running the program:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no GurobiJni56 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1764)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1044)
at gurobi.GurobiJni.<clinit>(GurobiJni.java:193)
at gurobi.GRBEnv.<init>(GRBEnv.java:16)
at gurobi.GRBEnv.<init>(GRBEnv.java:11)
at Model.main(Model.java:426)
Thank you in advance! Let me know if the information I have provided is not sufficient to answer my issue.
Henrik
Try to add the directory that contains the library libGurobiJni56.jnilib to the java.library.path property.
You can do it by adding this to the javavm arguments:
-Djava.library.path=/path/to/libGurobiJni55/
Or in eclipse like in this question:
How to set the java.library.path from Eclipse
这篇关于线程“主”中的异常java.lang.UnsatisfiedLinkError:否java.library.path中的GurobiJni56的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!