The Joy of Java 3D

by Greg Hopkins

Copyright © 2001-2011



Java 3D is an addition to Java for displaying three-dimensional graphics. Programs written in Java 3D can be run on several different types of computer and over the internet.

The Java 3D class library provides a simpler interface than most other graphics libraries, but has enough capabilities to produce good games and animation. Java 3D builds on existing technology such as DirectX and OpenGL so the programs do not run as slowly as you might expect. Also, Java 3D can incorporate objects created by 3D modeling packages like TrueSpace and VRML models.

This tutorial is an introduction to Java 3D. Examples lead you through the basic methods for producing 3D images and animation. You do not need to have any knowledge of 3D graphics or Java 3D to learn from this tutorial, but it will help if you have a basic understanding of the Java programming language. Programming in three dimensions can seem complicated because of the amount of jargon and the mathematics involved, this tutorial will keep things as simple as possible.

Please help to improve this tutorial for future readers by reporting any mistakes you find or suggesting improvements to

Installing and Running Java 3D

The software you need to use Java 3D is available free from Oracle at

Oracle often releases new versions so it is better to look at their site than rely on this document to find what you need. You will have to register as a member of "Java Developer Connection" to download some of the files.

At time of writing the newest version of Java is (1.7) and the current version of the Java 3D extension (1.5.2) is at

Once you have installed Java and Java 3D you can compile programs using the command:


And run them using:

java FileName

The FileName should always be the same as the name of the class defined in that file. In some versions of Java 3D you may get a message about a null graphics configuration, but you can just ignore this.

Table of Contents >>> Getting Started - Your First Program