eclipse UnsatisfiedLinkError:java.library.path 中没有 j3dcore-ogl

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14677079/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 19:56:33  来源:igfitidea点击:

UnsatisfiedLinkError: no j3dcore-ogl in java.library.path

javaeclipseexceptionjava-3dunsatisfiedlinkerror

提问by user1630850

I have a project in eclipse, runs perfectly fine in the ide when I click run, but I need to export it into a runnable jar file which also works fine. But when I try to run it it throws an exception:

我在 Eclipse 中有一个项目,当我单击运行时,它在 ide 中运行得非常好,但我需要将它导出到一个可运行的 jar 文件中,该文件也可以正常工作。但是当我尝试运行它时,它抛出一个异常:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no j3dcore-ogl in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1856)
    at java.lang.Runtime.loadLibrary0(Runtime.java:845)
    at java.lang.System.loadLibrary(System.java:1084)
    at javax.media.j3d.NativePipeline.run(NativePipeline.java:231)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.media.j3d.NativePipeline.loadLibrary(NativePipeline.java:200)
    at javax.media.j3d.NativePipeline.loadLibraries(NativePipeline.java:157)
    at javax.media.j3d.MasterControl.loadLibraries(MasterControl.java:987)
    at javax.media.j3d.VirtualUniverse.<clinit>(VirtualUniverse.java:299)
    at javax.media.j3d.GraphicsConfigTemplate3D.getBestConfiguration(GraphicsConfigTemplate3D.java:321)
    at java.awt.GraphicsDevice.getBestConfiguration(GraphicsDevice.java:207)
    at com.sun.j3d.exp.swing.JCanvas3D.<init>(JCanvas3D.java:228)
    at com.sun.j3d.exp.swing.JCanvas3D.<init>(JCanvas3D.java:178)
    at mainproject.MainPanel.<init>(MainPanel.java:72)
    at mainproject.MainWindow.<init>(MainWindow.java:42)
    at mainproject.MainWindow.main(MainWindow.java:23)

I have been googling it for 2 days now, tons of results, none helpful. I export it by going to file->export->java->Runnable jar file->i bubble extract required libraries into generated jar, choose the correct configuration, save the file in a specified folder, then it saves just fine. Or at least so I think. The java.library.pathgoes to the jre lib folder, but when i run it in eclipse it goes to the .so for j3d, i tried changing it using System.setPropertybut to no success. I have a feeling that is the problem, but when I tried to fix it nothing happened. I'm using the most up to date java3d library (1.5.2 I believe).

我已经用谷歌搜索了 2 天了,很多结果,没有任何帮助。我通过转到导出它file->export->java->Runnable jar file->i bubble extract required libraries into generated jar,选择正确的配置,将文件保存在指定的文件夹中,然后保存就好了。或者至少我是这么认为的。在java.library.path去的jre lib folder,但是当我在Eclipse中运行它,它去了。所以对于J3D,我尝试了用改变System.setProperty,但没有成功。我有一种感觉,那就是问题所在,但是当我尝试修复它时,什么也没有发生。我用的是最新的java3d library (1.5.2 I believe)

Any suggestions?

有什么建议?

回答by Raphael

If I set export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/jni it works.

如果我设置 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/jni 它工作。