本文介绍了无法使用已安装的Java 3D的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在命令提示符和netbeans中使用Java 3d.我有一个win8 64位计算机.我安装了j3d-1_5_2-windows-amd64.exe.并将其安装在名为Java3D的文件夹中的java文件夹内.然后我添加了一个环境变量作为CLASSPATH,其值是C:\ Program Files \ Java \ Java3D \ 1.5.2 \ lib \ ext \ j3dcore.jar; C:\ Program Files \ Java \ Java \ Java3D \ 1.5.2 \ lib \ ext \ j3dutils.jar; C:\ Program Files \ Java \ Java3D \ 1.5.2 \ lib \ ext \ vecmath.jar.当我尝试使用命令java -cp从命令提示符运行它时,我的文件被正确编译. Hello3d,它给出了javax/media/j3d/Node的calss not found错误.当我尝试从netbeans导入3d库时,在导入com.sun之后在j3d上给出了一个错误.以下是我从命令提示符下编译的类.请告诉我我在做什么错.提前谢谢

hi i'm trying to use java 3d in both command prompt and in netbeans. I have a win8 64 bit computor. I installed j3d-1_5_2-windows-amd64.exe. and it got installed inside java folder in a folder called Java3D. then I added an environmental variable as CLASSPATH and the values are C:\Program Files\Java\Java3D\1.5.2\lib\ext\j3dcore.jar;C:\Program Files\Java\Java3D\1.5.2\lib\ext\j3dutils.jar;C:\Program Files\Java\Java3D\1.5.2\lib\ext\vecmath.jar. my file get compilled without errors when I try to runit from command prompt using the command java -cp . Hello3d it gives a calss not found error for javax/media/j3d/Node. and when i try to import 3d libraries from netbeans it gives an error on j3d after import com.sun. the following is the class I compiled from command prompt. please tell me what i'm doing wrong. thanx in advance

import com.sun.j3d.utils.universe.SimpleUniverse;
import com.sun.j3d.utils.geometry.ColorCube;
import javax.media.j3d.BranchGroup;
public class Hello3d {
public Hello3d()
{
   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 ) {
   new Hello3d();
}
} // end of class Hello3d

推荐答案

您使用的Java3D版本(1.5.2)已过时,此版本已停止使用了几年.请卸载它并安装最新版本(1.6.0).按照我的说明此处.

You use an obsolete version (1.5.2) of Java3D, this version is no longer maintained since a few years. Please uninstall it and install the latest version (1.6.0). Follow my instructions here.

这篇关于无法使用已安装的Java 3D的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 01:20