编译错误:java.lang.UnsatisfiedLinkError: java.library.path 中没有 J3D
我在 java 中运行第一个带有 3D 图形的程序,但它有一个例外 请帮我解决这个问题。 这是我的代码:
public class Test extends Applet {
public Test() {
SimpleUniverse universe = new SimpleUniverse();
BranchGroup group = new BranchGroup();
group.addChild(new ColorCube(0.3));
universe.getViewingPlatform().setNominalViewingTransform();
universe.addBranchGraph(group);
}
}
public static void main(String[] args) {
// TODO code application logic here
new Test();
}
}
这是错误
Exception in thread "main" java.lang.UnsatisfiedLinkError: no J3D in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at javax.media.j3d.MasterControl$22.run(MasterControl.java:889)
at java.security.AccessController.doPrivileged(Native Method)
at javax.media.j3d.MasterControl.loadLibraries(MasterControl.java:886)
at javax.media.j3d.VirtualUniverse.<clinit>(VirtualUniverse.java:229)
at test1.Test.<init>(Test.java:26)
at test1.Main.main(Main.java:19)
Java Result: 1
BUILD SUCCESSFUL (total time: 2 seconds)
I run my first program with 3D graphics in java but it has one exception
please help me in solve that.
this is my code:
public class Test extends Applet {
public Test() {
SimpleUniverse universe = new SimpleUniverse();
BranchGroup group = new BranchGroup();
group.addChild(new ColorCube(0.3));
universe.getViewingPlatform().setNominalViewingTransform();
universe.addBranchGraph(group);
}
}
public static void main(String[] args) {
// TODO code application logic here
new Test();
}
}
and this is it's error
Exception in thread "main" java.lang.UnsatisfiedLinkError: no J3D in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at javax.media.j3d.MasterControl$22.run(MasterControl.java:889)
at java.security.AccessController.doPrivileged(Native Method)
at javax.media.j3d.MasterControl.loadLibraries(MasterControl.java:886)
at javax.media.j3d.VirtualUniverse.<clinit>(VirtualUniverse.java:229)
at test1.Test.<init>(Test.java:26)
at test1.Main.main(Main.java:19)
Java Result: 1
BUILD SUCCESSFUL (total time: 2 seconds)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Java3D 的某些部分需要本机库才能工作。
请参阅此处了解必要内容的说明。
Some bits of Java3D require native libraries to work.
See here for a description of what's necessary.
似乎您试图导入不存在或位于错误位置的库。
Seems like you trying to import a library that doesn't exist, or is in the wrong location.