0
votes

I have actually searched but haven't found a solution in any website. I am trying to write a program in Java using Java3D in MacOS and I'm trying to use Java3D in Eclipse. I am trying to run a simple HelloUniverse code but I am getting the following exception:

Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no J3D in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
    at java.lang.Runtime.loadLibrary0(Runtime.java:845)
    at java.lang.System.loadLibrary(System.java:1084)
    at javax.media.j3d.MasterControl$22.run(MasterControl.java:891)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.media.j3d.MasterControl.loadLibraries(MasterControl.java:888)
    at javax.media.j3d.VirtualUniverse.(VirtualUniverse.java:233)
    at HelloUniverse.createUniverse(HelloUniverse.java:100)
    at HelloUniverse.(HelloUniverse.java:126)
    at HelloUniverse$1.run(HelloUniverse.java:161)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:701)
    at java.awt.EventQueue.access$000(EventQueue.java:102)
    at java.awt.EventQueue$3.run(EventQueue.java:662)
    at java.awt.EventQueue$3.run(EventQueue.java:660)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:671)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)

I have already added j3dcore.jar vecmath.jar and j3dutils.jar and a bunch of other libraries to my build path but it doesn't seem to work.

Can anybody help me with using Java3D in eclipse in Mac?

thanks

1

1 Answers

0
votes

java.lang.UnsatisfiedLinkError indicates you are missing a required native library. Java3D consists of both JARs and native libraries. In your Java build path, find your Java3D JARs, click the arrow icon to open the options for each JAR, then select 'Native Library Location' and Edit. Point it to where the jnilib files are (probably /System/Library/Java/Extensions/).