How to set up JOGL in NetBeans

There are two ways to set up JOGL in NetBeans, either through the NetBeans OpenGL Pack or by setting up the library references manually. The plugin will probably be easier, but it will restrict the user to version 1.1.1a of JOGL. This is not a problem as long as the user do not want to explore the possibilities of JOGL 2.

Using NetBeans OpenGL Pack

These steps have been tested on Ubuntu, but should work for Windows or MacOS as well. The plugin was created for NetBeans 6.7, but it seems to work in 7.X as well (except for the GLSL shader editor).

  1. Download the plugin
  2. Extract the nbm-files to a temporary directory
  3. Start NetBeans and select Tools - Plugins in the top menu
  4. Select the Downloaded pane and press Add Plugin
  5. Browse to the temporary directory from the second step and select all nbm-files you would like to install (the GLSL editor causes trouble in 7.X)
  6. Complete the installation by pressing Install and complete the dialog
Once the installation is complete, the new project templates for JOGL project should be available in the create new project dialog.

Using Manual Referencing

If the operating system is Ubuntu, or any other Debian spin-off, then the proper libraries can be downloaded by installing the libjogl-java and libjogl2-java package. Otherwise the proper libraries must be downloaded from the JOGL website. The easiest way to do this is to go to this page and press the jogamp-all-platforms.7z link near the top of the page, but this will only download the newest stable release (the 1.1.1a release should be available in the archive).

  1. Download the desired library
  2. Create a new Java project
  3. Righ-click Libraries and select Add Library
  4. Press Create to create a new library
  5. Type in JOGL (or any other name) and press OK
  6. Select Add JAR/Folder and browse to the location of the jars
  7. Select the jar-files you want in the library (at least jogl-all.jar and gluegen-rt.jar)
  8. Finish the dialogs (optinally you can add the source package and javadoc as well under the Create Library dialog.