Setting up a JogAmp project in your favorite IDE: Difference between revisions

From JogampWiki
Jump to navigation Jump to search
m (Formatting)
m (Linked out to new download page)
Line 1: Line 1:
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.
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 JOGL =
= Download and install JOGL =


You can get the files for the latest stable version at https://jogamp.org/deployment/webstart/. You'll need to download eight things, shown below. Pick the "natives" JARs appropriate to your platform; we show 64-bit Windows versions in the examples below.
If you haven't done so already, download and install JOGL as described at [[Downloading_and_installing_JOGL]].
 
* <tt>gluegen-rt.jar</tt> (downloads as <tt>gluegen-rt.gz</tt>)
* <tt>gluegen-rt-natives-windows-amd64.jar</tt>
* <tt>jogl.all.jar</tt> (downloads as <tt>jogl.all.gz</tt>)
* <tt>jogl-natives-windows-amd64.jar</tt>
* <tt>nativewindow.all.jar</tt> (downloads as <tt>nativewindow.all.gz</tt>)
* <tt>nativewindow-natives-windows-amd64.jar</tt>
* <tt>newt.all.jar</tt> (downloads as <tt>newt.all.gz</tt>)
* <tt>newt-natives-windows-amd64.jar</tt>
 
Or if you want the latest automatic build, you can download it as one big file from https://jogamp.org/deployment/autobuilds/master/. Pick the most recent <tt>jogl-b*</tt> directory, then download the right zip file for your platform from it. For 64-bit Windows the file will be <tt>jogl-2.0-bvvv-2010mmdd-windows-amd64.zip</tt>.
 
Unzip or unjar all the files you downloaded, then pull out <tt>gluegen-rt.jar</tt>, <tt>jogl.all.jar</tt>, <tt>nativewindow.all.jar</tt> <tt>newt.all.jar</tt>, and all the <tt>.dll</tt> or <tt>.so</tt> files. These files form your JOGL installation, which you can put wherever you want.
 
This installation contains all of JOGL. If you want to trim it down, see https://jogamp.org/jogl/doc/deployment/JOGL-DEPLOYMENT.html for more information.


= Create a JOGL user library =
= Create a JOGL user library =

Revision as of 20:57, 17 January 2011

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.