Areas


Topics

j3d.org

Using J3D in IDEs

  1. Eclipse
  2. Symantec Visual Cafe
  3. Borland JBuilder
  4. Visual J++
  5. IBM Visual Age
  6. Kawa
  7. JCreator
  8. Forte
  9. Eclipse
  10. TogetherJ 5.0+
  11. Netbeans

Return to the main FAQ page for more questions and answers.

 

1. Eclipse

There are no currently known Eclipse plugin variants of Java3D. It should be relatively easy to add this capability. However, note that Java3D is heavily dependent on AWT. Eclipse does support mixing AWT and SWT, but on MacOSX there are some critical issues with this (ie locks the computer solid due to event models between Carbon and Cocoa clashing).

 

2. Symantec Visual Cafe
Contributor: Scott Eberline

Symantec Visual Cafe Professional 3.0a can debug Java 3D applications. This note describes what I did to get it working.

Installation Locations

The steps below assume that Java is installed in the following directories.

        c:/JavaSoft/JRE/1.2/bin/...
        c:/JavaSoft/JRE/1.2/lib/...

        c:/JavaSoft/jdk1.2.1/bin/...
        c:/JavaSoft/jdk1.2.1/jre/...
        c:/JavaSoft/jdk1.2.1/lib/...

Note that the JRE hierarchy contains both JRE 2 and the J3D runtime. Similarly, the JDK hierarchy contains both JDK 1.2.1 and the J3D SDK.

PATH Environment Variable

My PATH is as follows. It is important that the JDK bin directory appear before the NT system32 directory, which probably contains some (half crippled) java.exe file.

        c:/JavaSoft/jdk1.2.1/bin
        c:/WINNT/system32
        c:/WINNT
        c:/VisualCafe/bin
        c:/VisualCafe/Java/bin

CLASSPATH Environment Variable

My CLASSPATH is pretty minimal. Everything that properly belongs in the JRE lib/ext folder will be found there automatically by the JVM. (Cafe will need to be told explicitly where to locate those other jars, but not through CLASSPATH.) My CLASSPATH therefore only contains directories specific to my application; for this example, assume it to be unset.

This is probably a good point to try J3D HelloUniverse.

Configuring Cafe Project Options

Under Project Options, Directories tab, the directory list for "Input class files" needs to contain the following directories:

        d:\JavaSoft\jdk1.2.1\jre\lib
        d:\JavaSoft\jdk1.2.1\jre\lib\ext

Configuring Cafe Environment Options

This is the important part. You must define a new VM to plug into Cafe. First, look at the Cafe readme (e.g. c:/VisualCafe/ReadMe.html), under the topic "Enhanced Pluggable VM Debugging Support for 3.0a". I've defined a VM called JDK 1.2.1, as follows:

        Compiler classpath        {see below}
        Use VM executable         D:/JavaSoft/jdk1.2.1/bin/java.exe
        Classpath specifier       -classpath
        Classpath                 {see below}
        Other command options     {empty}
        VM path                   D:/JavaSoft/jdk1.2.1/bin/
        Use debugger executable   {empty}
        Javadoc executable        {empty}

The entries for "Compiler classpath" and "Classpath" are identical. Jar files to include in searchpaths for the compiler, VM and debugger:

        c:/JavaSoft/jdk1.2.1/lib/dt.jar
        c:/JavaSoft/jdk1.2.1/lib/tools.jar
        c:/JavaSoft/jdk1.2.1/jre/lib/i18n.jar
        c:/JavaSoft/jdk1.2.1/jre/lib/jaws.jar
        c:/JavaSoft/jdk1.2.1/jre/lib/rt.jar
        c:/JavaSoft/jdk1.2.1/jre/lib/ext/iiimp.jar
        c:/JavaSoft/jdk1.2.1/jre/lib/ext/j3daudio.jar
        c:/JavaSoft/jdk1.2.1/jre/lib/ext/j3dcore.jar
        c:/JavaSoft/jdk1.2.1/jre/lib/ext/j3dutils.jar
        c:/JavaSoft/jdk1.2.1/jre/lib/ext/vecmath.jar

plus the Visual Cafe jars. The total Cafe JDK 1.2.1 classpath is this:

	.;
	c:\JavaSoft\jdk1.2.1\lib\dt.jar;
	c:\JavaSoft\jdk1.2.1\lib\tools.jar;
	c:\JavaSoft\jdk1.2.1\jre\lib\i18n.jar;
	c:\JavaSoft\jdk1.2.1\jre\lib\jaws.jar;
	c:\JavaSoft\jdk1.2.1\jre\lib\rt.jar;
	c:\JavaSoft\jdk1.2.1\jre\lib\ext\iiimp.jar;
	c:\JavaSoft\jdk1.2.1\jre\lib\ext\j3daudio.jar;
	c:\JavaSoft\jdk1.2.1\jre\lib\ext\j3dcore.jar;
	c:\JavaSoft\jdk1.2.1\jre\lib\ext\j3dutils.jar;
	c:\JavaSoft\jdk1.2.1\jre\lib\ext\vecmath.jar;
	C:\VisualCafe\JAVA\LIB;
	C:\VisualCafe\JAVA\LIB\SYMCLASS.ZIP;
	C:\VisualCafe\JFC\SWINGALL.JAR;
	C:\VisualCafe\Bin\COMPONENTS\SFC.JAR;
	C:\VisualCafe\Bin\COMPONENTS\SYMBEANS.JAR;
	C:\VisualCafe\JAVA\LIB\Collections.zip;
	C:\VisualCafe\JAVA\LIB\icebrowserbean.jar;
	C:\VisualCafe\JAVA\LIB\jsdk.jar;
	C:\VisualCafe\JAVA\LIB\SYMTOOLS.JAR

If you shutdown Cafe and restart it, it may parse everything in the classpath and place a .vep file in your JDK bin directory. This is normal and expected.

Enrique Dumas adds: Visual Cafe 4.1 the only things needing to be modified after the install is to configure the internal virtual machine to set j3d jar path needed by VC (in jre/ext/lib)

 

3. Borland JBuilder

Firstly you need to register the JARs as libraries so that the system can find them. Under the Tools menu item there is an option Configure Libraries. In that you will have to create new library. When you are creating a new library for Java3d you will have to give the path of following files

vecmath.jar
j3daudio.jar
j3dcore.jar
j3dutils.jar

These can be found in the directory $jbuilder.home/java/jre/lib/ext. If they are not there, make sure that you choose the $jbuilder.home directory when you install Java 3D. Or, if you know what you are doing, copy them there from the standard JDK install place. As they are standard extensions, the JAR files must also be under the JBuilder JRE area in order to run when you try to run the debugger within the IDE.

Now, to use that library in your particular project go to Project | Properties dialog. There under Required Libraries, you have to add the Java3D library that you created earlier.

 

4. Visual J++
Contributor: Schlomo Herskop

Go to the menu item project->properties->classpath

If you have installed the J3D core libraries under the c:\jdk12 directory then manually add the JAR files

c:\jdk12\jre\lib\ext\j3dcore.jar
c:\jdk12\jre\lib\ext\j3dutils.jar
c:\jdk12\jre\lib\ext\j3daudio.jar
c:\jdk12\jre\lib\ext\vectmath.jar

j3d.org also maintains a page on how to modify J++ to use the Sun JVM that may be of interested to you.

 

5. IBM Visual Age
Contributor: Viktor Panassov

This tip applies to VAJ v3.5 working with Java3D (don't know if it will work with any others):

  • Import the 4 Java 3D JAR files vecmath.jar, j3dcore.jar, j3dutils.jar, j3daudio.jar into the workspace.
  • Put the two J3D DLLs J3D.dll and j3daudio.dll into the VAJ installation directory (eg c:\Program Files\VisualAge\ide\program

After this you will be able to develop and compile Java3D programs without any problems. However, if you want to run your programs inside the VAJ, you should remember one tip: Never resize Canvas3D, or less VAJ will hang. And don't forget to remove the second call to setSize() in the main() method pregenerated by VAJ. This last call takes place after the Canvas3D has been made visible!

 

6. Kawa

Kawa 3.51 works straight out of the box with no extra configuration necessary.

 

7. JCreator
Contributor: Mike Rutter

Configure -> Options
Select JDK Profiles
Select the jdk from the list box that you are using.
Click on "Edit..."
Make sure the "Classes" tab is selected
Click on "Add"
Select "Add Package..."
browse to %JAVA3D_INSTALL_DIR%/jre/lib/ext and select vecmath.jar, 3dcore.jar, j3dutils.jar, and j3daudio.jar

 

8. Forte
Contributor: Tyler Weir

Open forte
Open the Explorer window
Context-Click on the "Filesystems" node [first in the list]
Select "Mount JAR..."
Go to %JAVA_HOME/jre/lib/ext
Add the J3D .jars, one at a time
Back in the Explorer Window, Context-Click on a .jar file, pick "Tools" > "Update Parser Database", name the parser DB file, and select "All" for each of the three choice sets.
Repeat for the other J3D .jars.

 

9. Eclipse
Contributor: Greg Pierce

  1. From the Resource Perspective, right click on the root of the project in the Navigator and select Properties from the drop down list box.
  2. Select the "Java Build Path" entry in the tree.
  3. Select the "Libraries" tab
  4. Click The "Add External Jars" button
  5. Browse to and select all of the external jars for Java3D.
  6. Click OK and it's all done

 

10. TogetherJ 5.0+
Contributor: Greg Pierce

  1. From the file menu select "Project Properties"
  2. Click on the "Search/Classpath" tab
  3. Click on the "Add Path or Archive" button
  4. Select the jar files for Java3D
  5. Click OK and it's all done

 

11. Netbeans

Netbeans has a plugin that will do the integration for you. It can be found at java3d.netbeans.org. Not only will it support Java3D, it also allows dynamic visuallisation of your scene graph as you are creating it. Requires J3D 1.3 to run though.