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

user1630850 picture user1630850 · Feb 3, 2013 · Viewed 11.4k times · Source

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:

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$1.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.path goes 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.setProperty but 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).

Any suggestions?

Answer

Raphael picture Raphael · Apr 3, 2020

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