我实际上已搜索过但未在任何网站中找到解决方案。我正在尝试使用MacOS中的Java3D编写Java程序,我正在尝试在Eclipse中使用Java3D。我试图运行一个简单的HelloUniverse代码,但我得到以下异常:
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)
我已经在我的构建路径中添加了j3dcore.jar vecmath.jar和j3dutils.jar以及一堆其他库,但它似乎无法正常工作。
有人可以帮我在Mac中的eclipse中使用Java3D吗?
感谢
答案 0 :(得分:0)
java.lang.UnsatisfiedLinkError
表示您缺少必需的本机库。 Java3D由JAR和本机库组成。在Java构建路径中,找到Java3D JAR,单击箭头图标打开每个JAR的选项,然后选择“Native Library Location”和“Edit”。将它指向jnilib文件的位置(可能是/ System / Library / Java / Extensions /)。