Introduction to Programming with Java 3D
Using the Java examples

These tutorial notes include dozens of separate Java applications illustrating the use of Java 3D. The source code for these applications is included in files with .java file name extensions. Compiled byte-code for these Java files is not included! To use these examples, you will need to compile the applications first.

Compiling Java

The source code for all Java 3D examples is in the examples folder. Images, sound, and geometry files used by these examples are also contained within the same folder. A README.txt file in the folder lists the Java 3D applications included therein.

To compile the Java examples, you will need:

  • The Java 3D API 1.1 class files (or later)
  • The Java JDK 1.2 (Java 2 Platform) class files (or later)
  • A Java compiler

The JDK 1.2 class files are available for free from JavaSoft at http://www.javasoft.com.

The Java 3D class files are available for free from Sun Microsystems at http://www.sun.com/desktop/java3d.

There are multiple Java compilers available for most platforms. JavaSoft provides the Java Development Kit (JDK) for free from its Web site at http://www.javasoft.com. The JDK includes the javac compiler and instructions on how to use it. Multiple commercial Java development environments are available from Microsoft, Symantec, and others. An up to date list of available Java products is available at Developer.com's Web site at http://www.developer.com/directories/pages/dir.java.html.

Once you have the Java API class files and a Java compiler, you may compile the supplied Java files. Unfortunately, we can't give you explicit directions on how to do this. Each platform and Java compiler is different. You'll have to consult your software's manuals.

Running the Java 3D Examples

To run a Java application, you must run the Java interpreter and give it the Java class file as an argument, like this:

    java MyClass

The Java interpreter looks for the file MyClass.class in the current directory and loads it, and any additional files needed by that class.