Installing Java3D on Eclipse

user600842 picture user600842 · Feb 10, 2011 · Viewed 12.3k times · Source

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!

Answer

torbinsky picture torbinsky · Feb 11, 2011

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

  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

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

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:

  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"