Setting up a JogAmp project in your favorite IDE

From JogampWiki
Revision as of 20:57, 17 January 2011 by Wwalker (talk | contribs) (Linked out to new download page)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

It's very simple to set up an Eclipse project to use JOGL. These instructions assume you've already created a new project in Eclipse and want to add the JOGL libraries to it.

Download and install JOGL

If you haven't done so already, download and install JOGL as described at Downloading_and_installing_JOGL.

Create a JOGL user library

You can make your new Eclipse project depend directly on all the JOGL JARs and native libraries, but it's inconvenient to do that every time you create a new project. Creating a user library bundles all the JOGL files together so you can include them in one step.

  • Click "Window > Preferences", then select "Java > Build Path > User Libraries" on the left.
  • Click the "New..." button, type "JOGL" for the library name, and click "OK".
  • Click the "Add JARs..." button, navigate to the directory where you've stored the JOGL JARs, select gluegen-rt.jar, jogl.all.jar, nativewindow.all.jar and newt.all.jar, then click "Open".
  • For each of these four JARs, expand it in the list, double-click "Native library location", type the directory where the JOGL .dll or .so files are stored, and click "OK".
  • Click "OK" to exit Preferences dialog.

Add JOGL to your project's dependencies

  • Right-click your project in the Package Explorer and clock "Properties".
  • Select "Java Build Path" and click the "Libraries" tab.
  • Click "Add Library...", select "User Library", click "Next", check "JOGL", and click "Finish".
  • Click "OK" to dismiss the Properties dialog.

That's it! You can now use JOGL in your project.