For e.g., on my Windows machine I’ve created a new workspace in C:\Users\Sol\jogl_work. Open Eclipse and create a new workspace for your JOGL projects (if this is the first time you use Eclipse you will be prompted to create a new workspace). For OS X, you can use Keka which can extract 7z archives.
In order to be able to extract the downloaded archive on Windows you will need 7-Zip. You can find the latest version of JOGL at, download jogamp-all-platforms.7z from this page: Personally, I prefer to put the eclipse folder in C:\Program Files for Windows or in the Applications folder for OS X. Now, Eclipse doesn’t come with an installer, you can simply copy the eclipse folder where you want on your computer and start Eclipse by double clicking the executable from the eclipse folder. Once the download is completed, extract the archive, you should end up with a folder named eclipse.
Next step is to install the Eclipse IDE, Eclipse IDE for Java Developers will work just fine, be sure to chose an Eclipse version that matches your JDK (if you’ve installed the 64 bits JDK chose the 64 bits Eclipse installer): Important be sure that the number from the above line matches the version of Java installed on your Mac. bash_profile file: 1 export JAVA_HOME=`/usr/libexec/java_home -v 1.8` On OS X, you can define the JAVA_HOME environment variable by simply adding the next line at the end of your. Setting the JAVA_HOME environment variable on OS X: For the value add %JAVA_HOME\bin% or %JAVA_HOME\bin% if the PATH variable was already defined: Repeat the above procedure and create a new environment variable named PATH, or, if this is already present, select Edit instead of New. Press New in the upper side of the above window, this will let you create a New User Variable, you should write JAVA_HOME in the name text box and the path to your JDK installation in the value text box, in my case this was C:\Program Files\Java\jdk1.8.0_25, be sure to replace this with the JDK path for your machine: Select the Environment Variables button in the above window, this should open the Environment Variables editor: On older Windows systems, right click My Computer and select Properties, after that you should see the System Properties window, select the Advanced menu. On Windows 8.1, right click on the Windows button and select System, after that chose Advanced system settings, you should now have the System Properties window open: If you don’t want to setup JAVA_HOME, you can jump to the next section. It is advisable, but optional for the purposes of this tutorial, to create an environment variable named JAVA_HOME, where you store the location of the JDK.
Setting the JAVA_HOME environment variable on Windows: Once the download is completed, start the installer and accept all the default options.
Use the above link to download the appropriate version of JDK for your machine:Īfter you confirm that you accept the license agreement for JDK, you can select which version of Java you need, for this tutorial I will use Java SE 8 64 bits for Windows (you can follow along on OS X, the procedure is essentially the same): Setting the JAVA_HOME environment variable on OS Xįirst thing that you need is to install JDK, the Java Development Kit, from Oracle.
If you know how to do some to these steps, you can use the next table of contents to go to the sections that present interest for you: The last section of the tutorial will exemplify how to create an OpenGL context and attach it to a window. The fifth section shows you how to configure JOGL as a user defined library in *Eclipse.
In the first four sections of this tutorial I will show you how to install Java and Eclipse on your computer, feel free to skip forward if you are an experienced Java developer. If you are more interested in writing Java games, you should check a more game friendly library like LWJGL or, even better, libGDX. JOGL is a good fit for a Java programmer that wants to learn OpenGL, it is particularly useful if you follow some OpenGL intro book or article. I thought his question was general enough to write a small post about creating a Java OpenGL getting started project. More specifically, he was interested in JOGL the Java bindings for OpenGL.
Recently, a reader of my OpenGL 101 series emailed me about how to get started with OpenGL in Java. Solarian Programmer My programming ramblings Home Archives Contact Privacy Getting started with JOGL (OpenGL bindings for Java) in Eclipse Posted on Decemby Paul