A JWS Installer for Checkers3D

I'll go through the six installer development steps again, this time for the Checkers3D application. Checkers3D was the first Java 3D example considered in Chapter 15.

The JWS portal page

Figure B-9. The JWS portal page

Write the Application

Checkers3D uses the OpenGL Windows version of Java 3D, and so requires:

j3daudio.jar

j3dcore.jar

j3dutils.jar

vecmath.jar

JAR files

J3D.dll

j3daudio.dll

J3DUtils.dll

Native libraries

They must be copied into the Checkers3D/ directory, resulting in Figure B-10.

The compileChk.bat batch file contains this line:

    javac -classpath "%CLASSPATH%;vecmath.jar;j3daudio.jar;
                             j3dcore.jar;j3dutils.jar" *.java

The Checkers3D.bat batch file has this:

    java -cp "%CLASSPATH%;vecmath.jar;j3daudio.jar;
                         j3dcore.jar;j3dutils.jar" Checkers3D
The initial Checker3D/ directory

Figure B-10. The initial Checker3D/ directory

Once the program has been tested, the application should be packaged as a JAR. The makeJar.bat batch file has this line to handle that:

    jar cvmf mainClass.txt Checkers3D.jar *.class

The manifest details in mainClass.txt are:

    Main-Class: Checkers3D
    Class-Path: vecmath.jar j3daudio.jar j3dcore.jar j3dutils.jar

The application now consists of eight files:

  • The application JAR file: Checkers3D.jar

  • Four Java 3D JAR files: j3daudio.jar, j3dcore.jar, j3dutils.jar, and vecmath.jar

  • Three native ...

Get Killer Game Programming in Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.