![]() |
![]() | ![]() |
|
Development Environment SetupIf you intend to compile the code from the repository, you will need to do some setup work. These guidelines should help you in this task.
System RequirementsOf course, being a Java3D library, we need Java 3D to work. We do assume that you are using the latest major release - at least v1.2. We can't guarantee that it will compile with earlier versions. We of course recommend that you have the absolute latest version to keep up to date with the bug fixes etc.For other system requirements, you need at least a J2SE v1.2 JDK. Also, for the device handler we use the JAXP API processing XML configuration files. If you do not have either of these, you can download them from here: There are no other hard requirements of the code. Of course, doing 3D graphics we recommend the best video card your money can buy. The nVidia GeForce cards are the current best of the crop in the PC market. Of course, the Sun hardware is well supported too :) Other platforms supported depend on what JOGL can handle. We know that a Mac version is running, but requires MacOS X 10.3, so you can't run this code on anything earlier than that.
Environmental BasicsThe code is built around a standard unix environment for setup. We use the various GNU tools to build the code - in particular there is a heavy reliance on GNU Make for the compilation.
You can of course compile the codebase by hand using Win32For Microsoft OS users, you will need to download and install cygwin from Redhat. This can be found at http://sourceware.cygnus.com/cygwin/. Follow the installation instructions. The default environment should be good enough for you.UnixYou really don't need to do much at all. Make sure that you have the GNU tools installed as we use a number of features from GNU Make. Standard make will not work.MacOSNo idea at this stage. There is no Java 3D port, so you're a bit out of luck here. However, if you are using Magician or GL4Java, then a lot of the code in this kit might be useful for there too. I believe MacOS X has a port of the GNU tools already complete so let us know if you do get the code compiling.Environment SettingsThe code relies on a single environment variable to be set calledPROJECT_ROOT .This variable will point to the root of the code,
that you have installed. Usually it will be placed somewhere like
/home/justin/projects/j3d.org/javrIf you are using cygwin, you will have to put the dos path to your code. For example: c:/cygwin/home/justin/projects/j3d.org/javrYes, the slashes are meant to be that way around. If you put the local unix-style path to the codebase then you will get javac complaining about errors or classes not found etc.
Many people have their own, personal classpath setups too. The makefile that
comes with this codebase ignores you standard export PROJECT_CLASSPATH=${CLASSPATH}If you are using BASH for your shell, then I find the following little setup handy in my .bashrc. This allows me to swap between various different projects on the fly: J3D_HOME=${HOME}/j3d.org J3D_DOS_HOME="c:/cygwin/home/justin/j3d.org" J3D_CVSROOT=":pserver:anonymous@lists.j3d.org:/home/cvs/j3d/cvsroot" J3D_CODE_PROJECT_ROOT="${J3D_DOS_HOME}/code" J3D_BASE_CLASSPATH="${TEST_CLASSPATH}" J3D_CODE_CLASSPATH="${J3D_CODE_PROJECT_ROOT}/classes" J3D_CODE_CLASSPATH="${J3D_CODE_CLASSPATH};${J3D_CODE_PROJECT_ROOT}/config" J3D_CODE_CLASSPATH="${J3D_CODE_CLASSPATH};${J3D_CODE_PROJECT_ROOT}/images" J3D_LIB_PATH= J3D_PATH=$PATH cd() { case $# in 0) builtin cd $HOME ;; 1) builtin cd $1 echo `pwd` ;; 2) dir=$1/$2 if [ ! -x $dir ] ; then echo $2 does not exist builtin cd $1 else builtin cd $dir echo `pwd` fi esac } j3d() { export PROJECT_HOME=${J3D_HOME} export AREA=j3d export PS1="[$AREA \W] \$ " export CVSROOT=$J3D_CVSROOT export LD_LIBRARY_PATH=$J3D_LIB_PATH export PATH=$J3D_PATH export PROJECT_ROOT=${J3D_CODE_PROJECT_ROOT} export CLASSPATH="${J3D_BASE_CLASSPATH};${J3D_CODE_CLASSPATH}" cd $PROJECT_HOME $1 }
Using the Build EnvironmentWith the environment variable set up, all you need to do isbash$ cd $PROJECT_ROOT bash$ makeThis will generate class files, a jar file and the javadoc for the classes. Various options with make are:
classes and jar directory are created by the
build process.
Building the class filesTo build the entire codebase from scratch, change to the project root directory. First time up, you will need to copy one file from themake directory. After the first time you will never need to do
it again. Now type:
[j3d javr] $ cp make/Makefile . [j3d javr] $ make clean [j3d javr] $ make classYou will now see make run off and do its thing. If everything compiles successfully, you will find all the .class files in the
$PROJECT_ROOT/classes directory. You may elect to use these
directly or build a JAR file for them
If you only wish to recompile a single directory then you can change to that directory and just type: [j3d javr] $ makeThis will then build only the local files. Building JAR filesIf you wish for a binary distribution of the code, they you can create the jar file with the command[j3d javr] $ make jarThese file will be built and placed in the $PROJECT_ROOT/jars
directory (if the directory does not exist it will be created). Unfortunately
the build process only currently creates a JAR for the executable content.
The config files and images used in the user interface code is not included.
You will need to create a separate, hand-built JAR for this. We do intend to
get this working sometime in the near future.
Building JavadocsOf course, no Java project is complete without the accompanying javadoc. This too can be generated using the make system. Before running the make process, you may want to customise the code for your system. We automatically attempt to link to any other javadoc that you have on your machine - in particular the Java 3D, JDK and XML projects. To include these, or to disable the ability, you will need to edit one of the makefiles.
Firstly change into the Now, to generate the documentation, change back to the project root directory and type [j3d javr] $ make javadocIf everything goes according to plan, you will see a big stream of printouts as the documentation is produced. After all this is finished, you will find the docs in the $PROJECT_ROOT/docs/javadoc directory.
Example CodeThe example code area does not use the makefiles to build the code. What this means is you have to hand compile each directory. Firstly, make sure that the classpath is setup correctly and points to your example directory(s) that you wish to compile and run. |
[ Home ]
[ License ]
[ javadoc ]
[ Online Examples ]
[ Download ]
[ j3d.org ] [ Code Repository ] [ J3D FAQ ] [ Tutorials ] [ Books ] [ Contact Us ] Hosted by Yumetech Last Updated: $Date: 2003-09-02 20:28:56 $ |