使用 JNI 的 Java 程序无法在 Eclipse 之外找到依赖的共享对象
我现在有一个程序正在 eclipse 中运行,并使用对我创建的共享对象的 JNI 调用作为系统上另一个共享对象的包装器。当我从 eclipse 内部运行它时,它工作得很好,但是当我使用以下命令从命令行运行它时,包装器调用的共享对象会抛出未定义的符号错误。
java -Djava.library.path=[库路径] com.[我的名字].[程序]
ldd 似乎没有表明共享对象中缺少任何库。我还尝试在 shell 中设置所有环境变量,我执行它的方式与 eclipse 环境相同,并且它执行相同的操作。非常感谢任何关于从这里去哪里的建议,我没有想法。
感谢您的帮助
I have a program that is running inside eclipse right now and uses a JNI call to a shared object I created as a wrapper for another shared object on the system. This works just fine when I run it from inside eclipse however when I run it from the command line with the following command the shared object that the wrapper calls throws a undefined symbol error.
java -Djava.library.path=[path to library] com.[my name].[program]
ldd does not seem to indicate that any libraries are missing from the shared object. I have also tried setting all the environmental variables in the shell that I execute it the same as the eclipse environment and it does the same thing. Any suggestions on where to go from here are greatly appreciated I am out of ideas.
Thank you for your help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您检查过
LD_LIBRARY_PATH
环境变量的值吗?Have you checked the value of the
LD_LIBRARY_PATH
environment variable?