How To Install and Compile Xj3D
Xj3D is an example implementation for the X3D specification. Specifically, Xj3D is a Java3D-based open-source loader, browser and exporter for Extensible 3D (X3D) graphics.
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 loginThe password is guest
We have successfully used the latest 1.4 Beta3 as well.
We have successfully used the latest 1.3 Beta1 release as well.
The Java API for XML Parsing (JAXP) is the package that we currently use for our XML/DOM interfaces. This package is installed by default with the JDK 1.4 releases.
The Java XML Pack is available at http://java.sun.com/xml/downloads/javaxmlpack.html.
Note: When installing make sure you select the UNIX shell scripts version of scripts
Download JUnit 3.7 from:
We recommend installing this package to c:/javaapis/junit3.7
We have modified the publically available version(submitted but not available yet) so the library is available in the lib directory(dtdparser113a.jar)
If you want the original files they can be downloaded here: DTD Parser
We recommend you place this file in the directory c:/javaapis/dom2
Currently we have not updated to the latest SAI released. So please download the currently supported verson from here: www.web3d.org/TaskGroups/source/jars/SaiX3d.jar and place it in your x3d/lib directory.
For reference the latest is located at SaiX3d.jar
All the examples here assume you have installed the Xj3D codebase into "c:/xj3d". Modify these as needed for your local setup. Here is a sample .bashrc that you can use. Type:
x3dto setup your paths for x3d development. Here are the paths you will need. All locations assume the default install directories specified above.
export PATH="c:/jdk1.3.1/bin;c:/javacc2.1/bin;$PATH" export CLASSPATH="c:/xj3d;c:/xj3d/x3d" export PROJECT_CLASSPATH="c:/xj3d/x3d/lib/j3d-org.jar;c:/javaapis/rhino1_5R2/js.jar;c:/javaapis/junit3.7/junit.jar;c:/xj3d/x3d/lib/dtdparser113a.jar;c:/xj3d/x3d/lib/gnu_regexp-1.0.8.jar;c:/xj3d//x3d/lib/httpclient.jar;c:/xj3d/x3d/lib/j3d-org-images.jar;c:/xj3d/x3d/lib/uri.jar;c:/xj3d/x3d/lib/vlc_uri.jar;c:/xj3d/x3d/lib/SaiX3d.jar;c:/javaapis/dom2/dom2.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/x3d"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/x3dYou will also need to set the JAVA_HOME environment variable. This should point to the location you installed java. So for JDK1.3.1 you would use:
makedirectory into this directory.
cp make/Makefile .Now, to compile the code, simply change to this xj3d directory and type:
makeThis will build all of the classes and package them into JAR files for you. The JAR files can be found in the newly created
jardirectory. To automatically install these in the right place, type
make installThe 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
test: Build the test cases
cd examples/browser java DIYBrowser in location append "..\..\parsetest\geometry\box.wrl" hit the Go! button see box, rejoice! At this point you might want to look at the "How to Use Xj3D Tutorial" to see how you can use Xj3d in your projects.
Many thanks for developing this document goto:
Don Brutzman (NPS) and Joe Williams (HyperMultiMedia) and Alan Hudson(Yumetech)
Last Revised: $Date: 2002-02-06 18:42:24 $
The Uniform Resource Locator (URL) for this home page is www.web3D.org/TaskGroups/x3d/Xj3D/HowToInstall.html