
Here are the detailed steps to set up or install JOGL on your ubuntu. First of all you have to download the jogl library(according to your machine) from here . I am using Ubuntu 8.04 on intel board so i downloaded jogl-1.1.1-linux-i586.zip.
So extract the zip file. Now open the folder that you have just now extracted. Go to lib folder.
STEP 1: Now you have to copy four .so files i.e libjogl.so, libjogl_awt.so, libjogl_cg.so, libgluegen-rt.so to [javainstalation directory]/jre/lib/i386
Open the terminal window and type: sudo cp libjogl.so /usr/lib/java/jdk1.6.0_13/jre/lib/i386
similarly you have to copy other three .so files.
*you have to provide you java installation path*

Now you can check the destination if files has been copied.

STEP 2: Now copy jogl.jar and gluegen-rt.jar to [java installation di]/jre/lib/ext
run this command to copy: sudo cp jogl.jar /usr/lib/java/jdk1.6.0_13/jre/lib/ext
simillarly copy gluegen-rt.jar
*you have to provide your java installation path*

You can check:

STEP 3: SO thats it. Now lets test the simple jogl code.
import javax.media.opengl.GLCapabilities;
public class Hello{
public static void main (String args[]) {
try {
System.loadLibrary(“jogl”);
System.out.println(
“Hello World! (The native libraries are installed.)”
);
GLCapabilities caps = new GLCapabilities();
System.out.println(
“Hello JOGL! (The jar appears to be available.)”
);
} catch (Exception e) {
System.out.println(e);
}
}
}
Now compile this Hello.java and the run it. Here is the output:

So thats it. Now your are off to fly and write your jogl apps.
Thanks.
1. it is a very bad idea to deploy jogl in your jre, this will break a lot of apps. (esp. webstart and applets)
2. don’t load jogl natives explicitly it is already done by jogl.
-cp and -Djava.library.path is all you need to start a app with jar and native dependencies (in general) via cmd line. If you want to use applets or webstart just take a look at the jnlp extensions provided by jogl.
In other words: don’t follow this howto
Yeah michael bien is very correct. The above howto that i wrote is not very recommended. I am not a regular Ubuntu user and i was having problem setting classpath on ubuntu linux so i hacked it around and get my jogl app working using above steps.
Gracias.
When I compiled it I got these 22 errors for the above code..
saturn@saturn-desktop:~$ javac Hello.java
Hello.java:6: illegal character: \8220
System.loadLibrary(“jogl”);
^
Hello.java:6: ‘;’ expected
System.loadLibrary(“jogl”);
^
Hello.java:6: illegal character: \8221
System.loadLibrary(“jogl”);
^
Hello.java:6: ‘;’ expected
System.loadLibrary(“jogl”);
^
Hello.java:7: illegal character: \8220
System.out.println( “Hello World! The native libraries are installed.” );
^
Hello.java:7: ‘;’ expected
System.out.println( “Hello World! The native libraries are installed.” );
^
Hello.java:7: not a statement
System.out.println( “Hello World! The native libraries are installed.” );
^
Hello.java:7: ‘;’ expected
System.out.println( “Hello World! The native libraries are installed.” );
^
Hello.java:7: not a statement
System.out.println( “Hello World! The native libraries are installed.” );
^
Hello.java:7: ‘;’ expected
System.out.println( “Hello World! The native libraries are installed.” );
^
Hello.java:7: illegal start of expression
System.out.println( “Hello World! The native libraries are installed.” );
^
Hello.java:7: ‘;’ expected
System.out.println( “Hello World! The native libraries are installed.” );
^
Hello.java:7: ‘;’ expected
System.out.println( “Hello World! The native libraries are installed.” );
^
Hello.java:7: illegal character: \8221
System.out.println( “Hello World! The native libraries are installed.” );
^
Hello.java:9: illegal character: \8220
System.out.println( “Hello JOGL! The jar appears to be available.” );
^
Hello.java:9: ‘;’ expected
System.out.println( “Hello JOGL! The jar appears to be available.” );
^
Hello.java:9: not a statement
System.out.println( “Hello JOGL! The jar appears to be available.” );
^
Hello.java:9: ‘;’ expected
System.out.println( “Hello JOGL! The jar appears to be available.” );
^
Hello.java:9: ‘;’ expected
System.out.println( “Hello JOGL! The jar appears to be available.” );
^
Hello.java:9: ‘;’ expected
System.out.println( “Hello JOGL! The jar appears to be available.” );
^
Hello.java:9: ‘;’ expected
System.out.println( “Hello JOGL! The jar appears to be available.” );
^
Hello.java:9: illegal character: \8221
System.out.println( “Hello JOGL! The jar appears to be available.” );
^
22 errors
Please help
Its a problem with ur double quotes “”. Check it properly. Just correct it. I think you have copy and pasted the code from this post thats why instead of double quotes its different sign.
Thanks.
Hi!
Please modify your “howto” as Mickael suggested, it is not very difficult. Some people might have problems when using JOGL applications and applets because of it. Best regards.
yeah will do it asap. Thanks.