Using JOGL for Java OpenGL Programming in Eclipse

Preliminaries

This tutorial will teach you how to install JOGL in Eclipse for OpenGL programming in Java

This tutorial assumes that you have familiarity with Java programming and the Eclipse development environment. It also assumes that you have downloaded and installed Eclipse.

Step Zero

Download the appropriate version of JOGL:

jogl for Windows (x86)
or
jogl for Linux (x86)
or
jogl for Mac OS X (Universal)

Unpack the archive in the desired location.

Step One

Create a new project in Eclipse ("File->New->Java Project")

Step Two

Open the Project Properties ("Project->Properties")

Step Three

In the Project Properties, select the "Java Build Path" item. In the options window, select the "Libraries" tab

Step Four

Press the "Add External JARs..." button, and select "jogl.jar" in the "<<jogl-1.1.0>\lib\jogl.jar" directory. (where jogl-1.1.0 is the result of unpacking the archive downloaded in Step Zero.).

Step Five

Press the small "+" next to jogl.jar in the list of libraries, this expands to show four options. Select the "Native library location:" option and press the "Edit" button. Select the "<<jogl-1.1.0>\lib" directory.

Step Six

Repeat steps four and five, but this time select "gluegen-rt.jar"

You're Done!

Your project should now be set up to compile and run Java OpenGL code using JOGL.