本文介绍了线程"main"中的异常java.lang.UnsatisfiedLinkError:java.library.path中没有jep的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
下载jep后,我有'libjep.so'文件,并且还在〜./bashrc
中设置了环境变量 LD_LIBRARY_PATH
,如下所示:
I have 'libjep.so' file after downloading jep and I also had set the environmental variable LD_LIBRARY_PATH
in ~./bashrc
as shown below:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/python2.7/dist-packages/jep/libjep.so
以及在运行时
System.load("/usr/local/lib/python2.7/dist-packages/jep/libjep.so");
但是当我的代码中包含以下一行时,
But when I have the follwing line in my code,
Jep jep = new Jep();
它显示以下错误:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jep in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at jep.Jep$TopInterpreter$1.run(Jep.java:118)
at java.lang.Thread.run(Thread.java:745)
谢谢
推荐答案
您需要将LD_LIBRARY_PATH设置为包含您的库的目录,而不是这样的库本身
You need to set the LD_LIBRARY_PATH to the directory containing your library, and not your library itself like this
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/python2.7/dist-packages/jep/
您还可以在启动Java应用程序时尝试将此参数添加到java命令中,以便Java可以找到该库
You can also try adding this argument to the java command when you start your java application so java can find the library
-Djava.library.path=/usr/local/lib/python2.7/dist-packages/jep/
这篇关于线程"main"中的异常java.lang.UnsatisfiedLinkError:java.library.path中没有jep的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!