###############################################################################
First, the following utilities are required for successful compilation
Download them and save them to your compilation folder for ease of use:
###############################################################################
apache-ant version 1.7.0 or greater
source: http://ant.apache.org/bindownload.cgi
direct link: http://mirror.olnevhost.net/pub/apache/ant/binaries/apache-ant-1.7.0-bin.tar.gz
antlr version 2.7.2 (specifically this version, not any other!!!!!)
source: http://www.antlr2.org/download.html
direct link: http://www.antlr2.org/download/antlr-2.7.2.tar.gz
Obtain the latest (or desired) JOGL sources for glugen and jogl from here:
https://jogl.dev.java.net/servlets/ProjectDocumentList
# You will want to retrieve the 'src' package (for example: jogl-1.1.1-src.zip)
# Expand/Unzip this package into your compilation folder and it will create two
# directories: jogl/ and gluegen/
Now you are ready to compile…begin with gluegen compilation first and then move on to jogl
###############################################################################
Gluegen Compilation
###############################################################################
# Go into the ‘gluegen/make/’ folder and edit the ‘gluegen.properties’ file
cd gluegen/make
nano gluegen.properties (or use vi, or favorite editor)
# Update the location of 'antlr.jar' to the one that you downloaded above
# basically point to the antrl.jar path that you downloaded
e.g.: antlr.jar=/antlr-2.7.2/antlr.jar
# Comment out the references to win32 and macosx, etc since we are in Linux
# Copy the 'gluegen.properties' file to your home directory
# Not sure if this is necessary per se, but do it anyway:
cp gluegen/make/gluegen.properties ~/
# Now you are ready to compile it by using 'ant'...use the version that you
# downloaded in apache 1.7.0 or greater:
# Change into the gluegen/make directory
cd gluegen/make
# Beging the compilation of gluegen
apache-ant-1.7.0/bin/ant
# When complete, the compilation will place the gluegen files in the
# gluegen/build/ folder...check that these exist to make sure compilation
# was successful:
gluegen/build/gluegen.jar
gluegen/build/gluegen-rt.jar
gluegen/build/obj/libgluegen-rt.so
###############################################################################
JOGL Compilation
###############################################################################
# Go into the ‘jogl/make/’ folder and edit the ‘jogl.properties’ file
cd jogl/make
nano jogl.properties (or use vi, or favorite editor)
# Update the location of 'java.home.dir' to the one that contains
# the 64 bit linux libraries (when doing 64 bit linux)
java.home.dir=/jdk1.6.0_02
# Comment out the references to win32 and macosx, etc since we are in Linux
# These are commented out because we are NOT compiling on Windows or Mac a
# and don't have the Visual C++ Compiler, etc that would be needed. Is this wrong?
# Copy the 'jogl.properties' file to your home directory:
cp jogl/make/jogl.properties ~/
# Clear your CLASSPATH variable so that it does not include references
# to old jogl or gluegen jars/libraries,
export CLASSPATH=""
# Clear out JAVA_HOME variable as well:
export JAVA_HOME=""
# Now you are ready to compile it by using 'ant'...use the version that you
# downloaded in apache 1.7.0 or greater:
apache-ant-1.7.0/bin/ant
# When complete, the compilation will place the jogl files in the
# jogl/build/ folder:
jogl/build/jogl.jar
jogl/build/obj/libjogl_awt.so
jogl/build/obj/libjogl.so
###############################################################################
Compilations are complete so now you can copy the required jar files
and static libraries to a preferred location…these make up the files
needed to successful use of JOGL. Add the location of these files to
your CLASSPATH
###############################################################################
gluegen/build/gluegen.jar
gluegen/build/gluegen-rt.jar
gluegen/build/obj/libgluegen-rt.so
jogl/build/jogl.jar
jogl/build/obj/libjogl_awt.so
jogl/build/obj/libjogl.so
# The following is an example of how I add the files above to my CLASSPATH
# I edit my .bashrc file to point to the jogl library folder called: jogl_lib
JOGL=/jogl_lib
export CLASSPATH=$CLASSPATH:$JOGL/jogl.jar:$JOGL/gluegen-rt.jar
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JOGL
# the 'jogl_lib' folder is where I copied all of the above files to. It
# might be a good idea to create a separate folder for each version of jogl
# you have an then link to that folder instead of just using jogl_lib as the
# name....for example, copy all of the files to a folder called: jogl_v1.1.1
mkdir jogl_v1.1.1
cp * jogl_v1.1.1
# now create a symbolic link to the jogl_v1.1.1 folder:
ln -s jogl_v1.1.1 jogl_lib
# In the future you would just change the sybolic link to the new version of jogl
# in addition, I would suggest creating an alias to the 64 bit version of Java (when
# compiling for 64) in your .bashrc file:
alias java64=/jdk1.6.0_02/bin/java
###############################################################################
TESTING JOGL
###############################################################################
# Get the jogl demos source files for testing:
https://jogl.dev.java.net/servlets/ProjectDocumentList
# Unzip the sources and go into the jogl-demos/make directory:
cd jogl-demos/make
# Use ANT to compile the demos:
apache-ant-1.7.0/bin/ant
# Go into the jogl-demos/build to test JOGL...test using the JGears example:
# First you must make sure your CLASSPATH points to the jogl and gluegen
# jars (as was instructed to do in the section above)...if not then you
# will have to include them all in your path by hand....if instead you
# did have them added to the CLASSPATH variable then you should be able to
# type:
java64 -classpath $CLASSPATH:jogl-demos.jar demos.jgears.JGears
# else you might need to do something like this:
/jdk1.6.0_02/bin/java
-classpath .:/jogl_lib/jogl.jar:/jogl_lib/gluegen-rt.jar:
jogl-demos.jar demos.jgears.JGears