如何在Linux中将.so文件添加到java.library.path [英] How to add .so file to the java.library.path in Linux
问题描述
我正在使用一个Java应用程序,该应用程序需要Windows中java.library.path中的.dll
文件.要在Linux中运行相同的应用程序,我有相应的.so
文件,应将其添加到linux计算机的java.library.path
中,到目前为止,我没有找到任何简单的解决方案
I am working with a java application which needs a .dll
file in java.library.path in windows. To run same application in Linux I have the respective .so
file which should be added to java.library.path
in linux machine, I didnt find any easy solution for this so far
我确实将.so
放在了类路径中已经存在的文件夹中,但是我的应用程序仍然抱怨java.library.path
I did put the .so
in a folder which is already in the class path, but my application still complains there is no required .so
file in java.library.path
我想找到:
- 将
.so
添加到java.library.path
的方法 - 如何知道它是否已经添加(添加时)
- Ways to add
.so
tojava.library.path
- How to know if its already added (when added)
推荐答案
在启动应用程序之前将包含目录添加到LD_LIBRARY_PATH
Add the containing directory to LD_LIBRARY_PATH
before launching the application
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/some/pathOfContainingDirectory
使用java -XshowSettings:properties
显示java.library.path(和其他)值.
Use java -XshowSettings:properties
to show the java.library.path (and others) value.
这篇关于如何在Linux中将.so文件添加到java.library.path的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!