How To Install and Compile Xj3D
Xj3D is an example Open Source implementation for the X3D and VRML97 specifications.
This page is intended to help software developers examine and contribute to the source code. This is beta source code under active development. If you are just interested in using the codebase you do not need this document! We have a user install available here. This install includes everything you need to use Xj3D as a Java3D loader and includes a sample VRML97/X3D Browser.
Install the packages to whatever directories you like, but record their locations. We recommend a directory location that will be used in example paths. You will use these locations later to setup your CLASSPATH and PATH environment variables. If a package is mentioned as residing in the lib directory then we suggest you use that version. Some of these are hard to find, tracking at a different version or we have modified them.
CVS is included in the Cygwin distribution. The next steps will take you through downloading the Xj3D code. At this point you have a decision to make. You can either download the latest stable release or jump into the raw development stream. I'd recommend going for the latest stable release, you've got enough to do for now without worring about our untested changes!
Checking out the Code:
cvs loginHit enter for the password.
We have successfully used the latest 1.4.x series as well. We develop against the latest version of the JDK but maintain compatibility against the previous version as well as the current one. So, for example, when JDK 1.6 comes out, we will drop 1.4 support and require a minumum of 1.5.
Note: When installing make sure you select the UNIX shell scripts version of scripts
These instructions assume you've installed this in c:/javaapis/jinput
These instructions assume you've installed this in c:/javaapis/joal
The JMF installer will place the files where they are needed.
These install instructions assume you've installed this in your lib/ext directory. Be sure to get both the jar and native libraries for your platform.
There are some issues with the new Java3D 1.3.2 source versions that we haven't worked through yet.
$userid is your system userid.
All the examples here assume you have installed the Xj3D codebase into "c:/xj3d". Modify these as needed for your local setup.Here are the paths you will need. All locations assume the default install directories specified above. Replace for semi-colons with colons for real unix machines.export PATH="c:/jdk1.4.2_06/bin;c:/javacc3.2/bin;$PATH" export CLASSPATH="c:/xj3d/Xj3D;c:/xj3d/Xj3D/classes;c:/xj3d/Xj3D/lib/j3d-org.jar;C:/Program Files/JMF2.1.1/lib/jmf.jar;c:/xj3d/Xj3D/lib/aviatrix3d-all.jar;c:/xj3d/Xj3D/lib/vlc_uri.jar;c:/xj3d/Xj3D/lib/uri.jar;c:/xj3d/Xj3D/lib/opengis.jar;c:/xj3d/Xj3D/lib/units-0.01.jar;c:/xj3d/Xj3D/lib/gt2-main.jar;c:/xj3d/Xj3D/lib/odejava.jar;c:/xj3d/Xj3D/apps/browser/classes;C:/javaapis/jinput/coreAPI/lib/jutils.jar;C:/javaapis/jinput/plugins/DX8/lib/jinput.jar;C:/javaapis/jinput/plugins/DX8/bin/dxinput.jar;c:/xj3d/Xj3D/lib/dis.jar;c:/javaapis/rhino1_5R4_1/js.jar;c:/xj3d/Xj3D/lib/dtdparser113a.jar;c:/xj3d/Xj3D/lib/gnu_regexp-1.0.8.jar;c:/xj3d/Xj3D/lib/httpclient.jar;c:/xj3d/Xj3D/lib/j3d-org-images.jar" export PROJECT_CLASSPATH="c:/javaapis/rhino1_5R4_1/js.jar"The final step in the setup is to ready your personal environment so that our build scripts work. Building is provided using Make. For make to work correctly you will need to set the
PROJECT_ROOTenvironment variable. This points to the directory that you downloaded CVS into. For example, if you put the CVS code into c:/Xj3D/x3d, then you will need the following (including quotes):export PROJECT_ROOT="c:/xj3d/Xj3D"Note that this all assumes you are running in the cygwin environment. All the slashes are unix style, yet we need to put DOS style directories. If you are running on a unix machine, then put your normal unix style path here eg:export PROJECT_ROOT=/home/username/xj3d/Xj3DYou will also need to set the JAVA_HOME environment variable. This should point to the location you installed java. So for JDK1.4.2_06 you would use:export JAVA_HOME=c:/jdk1.4.2_06
Building the Xj3D sourceCopy the file
makedirectory into this directory.cp make/Makefile .Now, to compile the code, simply change to this xj3d directory and type:make parsersThis will build all of the parser source code using javacc
If you are using the default JOGL renderer type:make ogl
If you are using the Java3D renderer type:make j3d
If you are using the Mobile renderer type:make mobileThe make system provides a number of other options. These are listed below:
class: Build just the class files, no JARs
all: Do everything - JARS and javadoc
javadoc: Generate all of the Javadoc
examples: Compile the example applications
clean: Remove all the compiled library files
nuke: Remove all the binaries and JAR files for both library and examples
Typing justmakeWill provide a complete list of options available, including those for compiling a code for only a specific renderer.
To test that you have the codebase compiling correctly try the following:cd examples/browser javac OGLBrowser.java java OGLBrowser in location append "..\..\parsetest\events\moving_box.wrl" hit the Go! button see box, rejoice!
Last Revised: $Date: 2005-10-12 17:19:27 $