在 Eclipse 上安装 Java3D

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4963501/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 15:45:42  来源:igfitidea点击:

Installing Java3D on Eclipse

javaeclipsejava-3d

提问by user600842

Sorry in advance if this is a really bad question, but I can't seem to find a recent enough tutorial on how to install Java3D on Eclipse 3.6.0 for Mac OSX 10.6.6. If anyone knows where a good tutorial is, or if you can give me instructions, please do so. Thanks!

如果这是一个非常糟糕的问题,请提前抱歉,但我似乎找不到有关如何在 Mac OSX 10.6.6 的 Eclipse 3.6.0 上安装 Java3D 的最新教程。如果有人知道哪里有好的教程,或者您可以给我说明,请这样做。谢谢!

回答by torbinsky

To add the jar's to a specific project's classpath:

要将 jar 添加到特定项目的类路径

  1. Right-click (or cmd-click on mac?) your project in the Project Explorer view and choose Properties > Java Build Path > Libraries.
  2. Add the folder "\System\Library\Java\Extensions" by clicking the "Add External Class Folder..." button
  1. 在 Project Explorer 视图中右键单击(或在 mac 上单击 cmd?)您的项目,然后选择Properties > Java Build Path > Libraries
  2. 通过单击“添加外部类文件夹...”按钮添加文件夹“\System\Library\Java\Extensions”

EDIT:

编辑:

I would suggest the following, given that

鉴于此,我建议如下

  • you have the JDK (version 1.5.0 or higher) installed
  • you have Eclipse for Java or Java EE developers installed (not Eclipse Classic for example)
  • you can build a vanilla, HelloWorld Java application already
  • 您安装了 JDK(1.5.0 或更高版本)
  • 您已经安装了 Java 或 Java EE 开发人员的 Eclipse(例如,不是 Eclipse Classic)
  • 您已经可以构建一个普通的 HelloWorld Java 应用程序

Basically, it sounds like you might not have added the Java 3D api's to your JRE. The download you linked to in your original question contains a help file named README-unzip.html, which is where I obtained the following instructions from:

基本上,听起来您可能没有将 Java 3D api 添加到您的 JRE。您在原始问题中链接到的下载包含一个名为 README-unzip.html 的帮助文件,我从该文件中获得了以下说明:

  1. Download java3d-1_5_1-XXX.zip to a temporary directory, for example, "/tmp"

  2. Unzip java3d-1_5_1-XXX.zip into "/tmp" as follows:

        cd /tmp
        unzip java3d-1_5_1-*.zip
    

    This will create a "java3d-1_5_1-XXX" subdirectory in /tmp where the downloaded files can be found. The file you need for manual installation is "j3d-jre.zip".

  3. Unzip Java 3D 1.5.1 into the "jre" directory of your JDK. For example, if your JDK is in "/usr/java/jdk1.6.0_01/jre", you would do the following:

        cd /usr/java/jdk1.6.0_01/jre
        unzip /tmp/java3d-1_5_1-*/j3d-jre.zip
    

    Verify that the j3dcore.jar, j3dutils.jar, and vecmath.jar files end up in "/usr/java/jdk1.6.0_01/jre/lib/ext"

  1. 将 java3d-1_5_1-XXX.zip 下载到一个临时目录,例如“/tmp”

  2. 将 java3d-1_5_1-XXX.zip 解压到“/tmp”中,如下所示:

        cd /tmp
        unzip java3d-1_5_1-*.zip
    

    这将在 /tmp 中创建一个“java3d-1_5_1-XXX”子目录,可以在其中找到下载的文件。手动安装所需的文件是“j3d-jre.zip”。

  3. 将 Java 3D 1.5.1 解压到 JDK 的“jre”目录中。例如,如果您的 JDK 在“/usr/java/jdk1.6.0_01/jre”中,您将执行以下操作:

        cd /usr/java/jdk1.6.0_01/jre
        unzip /tmp/java3d-1_5_1-*/j3d-jre.zip
    

    验证 j3dcore.jar、j3dutils.jar 和 vecmath.jar 文件最终位于“/usr/java/jdk1.6.0_01/jre/lib/ext”

回答by InteractiveMesh

These threads might also be helpful:

这些线程也可能有帮助:

From: August

来自:八月

回答by karl

The previous instructions are NOT for installing java3d into Eclipse. In the same readme file it says: Users of IDEs such as NetBeans and Eclipse should consult the IDE's documentation to see how to add jar files and native libraries to their current project.

前面的说明不适用于将 java3d 安装到 Eclipse 中。在同一个自述文件中,它说: NetBeans 和 Eclipse 等 IDE 的用户应该查阅 IDE 的文档,以了解如何将 jar 文件和本机库添加到他们当前的项目中。