Using JOGL
How to install and use at Uni
You don’t have to do anything! It’s already installed!
But to use it you have to tell java where to find the JOGL libraries. The simplest method is to start a new 3421 environment:
% 3421
newclass starting new subshell for class COMP3421...
Now you can try the gears demo
cello [~] jogldemo gears
alternatively you can set your CLASSPATH and LD_LIBRARY_PATH environment variables with these shell commands
JOGL=/home/cs3421/jogl/jogl-1.1.1-linux-i586/lib/
export CLASSPATH=$CLASSPATH:$JOGL/jogl.jar:$JOGL/gluegen-rt.jar
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JOGL
Then you should be able to run the gears demo like this:
% ~cs3421/bin/jogldemo gears
There are more demos you can run — run jogldemo for a list. Some demos only work on the newer computers.
To compile and run your own JOGL programs, you just use javac in the usual way. My JOGL version of the first example (page 46) from Hill is here. Download it, compile it and you’re on your way. Chris Adamson’s tutorial explains how the example works and has some more things you can try.
How to install and run at home
You first need to install Java 6. Get it from the CSE Java homepage.
Download JOGL for your OS and architecture
Unzip this file somewhere.
Now you have to set your environment variables. For Linux it’s the same as at uni
JOGL=<the place you unpacked the zip file>/jogl-1.1.1-linux-i586/lib/
export CLASSPATH=$CLASSPATH:$JOGL/jogl.jar:$JOGL/gluegen-rt.jar
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JOGL
(or jogl-1.1.1-linux-amd64/lib if you have AMD64 architecture).
Mac installation is the same, except you use DYLD_LIBRARY_PATH instead of LD_LIBRARY_PATH.
In the instructions that follow, replace JOGL with the full path of the lib subfolder created when you unpacked the zip file. (You can move it somewhere else if you want to make the name easier to type.)
In Windows you have to set the Environment variables using the control panel. If you don’t have a CLASSPATH environment variable, create a new one containing just JOGL/jogl.jar;JOGL/gluegen-rt.jar;.. (That’s a semicolon and a period at the end.) Windows uses PATH instead of LD_LIBRARY_PATH, so you’ll have to add JOGL to PATH. For instance, if it is
C:\Windows\System32\;C:\Windows\;C:\Windows\System32\Wbem
you would edit it to be (note the semicolon)
C:\Windows\System32\;C:\Windows\;C:\Windows\System32\Wbem;JOGL
That’s it! You’re done. You can also install the demos. Download jogl-demos.jar, jogl-demos-util.jar and jogl-demos-data.jar. Put them somewhere and add those three files to your CLASSPATH.