JOGL Installation
Prerequisite:
Operating system | Any Operating system (Windows, Linux, Mac) |
Memory requirement | No minimum requirement |
Disk Space | No minimum requirement |
JDK version | JDK 1.4 or above |
For JOGL, you need to have java installed on your machine.
If you have already installed Java on your machine, you can verify the installation using the following commands:
For Windows:
- Open Command line.
- Type the command, C:\>java -version
- Press Enter key. It will show the current Java version installed on the machine.
For Linux:
- Open Command Terminal.
- Type the command, $ java-version.
- Press Enter key. It will show the current Java version installed on the machine.
If Java is not configured on your local machine follow below steps to install java:
1. Install Java SDK from Oracle website, https://www.oracle.com/java/technologies/javase-downloads.html
2. Install JDK from Download files.
3. Follow the instruction given in Documentation to install setup.
4. Set Path for Java compiler
For Windows,
Insert ‘;%JAVA_HOME% bin’ at the end of system variable and path
For Linux,
Export PATH=$PATH:$JAVA_HOME/bin/
5. Set Java_Home variable to the path in your local machine where java is installed
For Windows,
Set Java_Home variable to C:\Program Files\Java\jdk1.8.0_171
For Linux,
Export JAVA_HOME=/usr/local/java-current
Installing JOGL:
1. For Installing JOGL visit the website, www. jogamp.org
2. Visit the Home Page of the site.
3. In Build / Downloads section click on Current (zip) to download zips required for installation of JOGL.
4. A list of .jar files for all APIs is displayed
5. Download jogamp-all-platforms.7z, glugen-javadoc.7z, and JOGL jogl-javadocs.7z files.
6. Create One folder and extract all downloaded files in it. It mainly consists of 3 folders, gluegen, jogamp-all-platforms, jogl.
You can find multiple .jar files available in these folders. All these files belong to Gluegen and JOGL.
Various native libraries are provided by JOAMP. Different libraries support Windows, Linux, and Android operating system. According to your platform, you must choose right .jar files.
For Windows 64-bit operating system you need following .jar files from downloaded folders.
Open the folder jogamp-all-platforms.
Select the following .jar files:
- gluegenrt, jar
- jogl-all.jar
- gluegen-rt-natives-windows-amd64.jar
- jogl-all-natives-windowsamd64.jar
Using JOGL on Eclipse platform:
For setting up JOGL for Eclipse, you need to follow below steps:
1. Open the Eclipse IDE and select the appropriate workspace.
2. Create a new Java project. Give a proper name and click on the Finish button.
3. Right-click on the project name and select new folder. Give name lib to folder.
4. Copy following .jar files in lib folder
- gluegen-rt-natives-windows-amd64.jar
- gluegenrt.jar
- jogl-all-natives-windowsamd64.jar
- jogl-all.jar
5. Select all .jar files in the lib folder. Right-click on these files then click on Build Path and select Add to Build Path. All .jar files will get added to Referenced Libraries.
6. These .jar files must be available to all projects in the workspace. For this purpose, navigate to main menu, Select Window menu, and select Preferences in it. The preferences window will appear on the screen.
7. Expand Java option available in Preferences window, on the left side then select Build Path and then User Libraries.(Java->Build Path->User Libraries).
8. Click on New button to create a new Library.
9. A dialog box will open enter the library name as jogl2.1
10. Then Click on Add External JARs. Add jar files glugen-rt.jar and jogl-all.jar and click on Ok.
11. Click on Apply and Close. This will create a new Library jogl2.1
Adding native libraries:
- Select the java doc location from jogl-all.jar (none).
- Now, enter the name for the document after pressing the new button.
- Click on Add External JARs button.
- Now you have to select the path of jogl java documentation.
Adding the source code:
- Select node Native library location to none.
- Click on the New button.
- Type the name of native libraries and select the ok button.
- Press Add External JAR button available there.
- Then, we have to select the path where our native libraries, gluegen-rt-natives-windows-amd64.jar, jogl-all-natives-windowsamd64.jar are located.
- We have to repeat this same process for source code.
- In the same way, we can configure locations for source code, Javadoc, and jar files for native libraries gluegen-rt-natives-windows-amd64.jar and gluegen-rt.jar
Steps for Configuring JOGL in NetBeans:
1. Select the Tools menu in the main menu and click on Libraries.
2. It will open Ant Library Manager.
3. In the Classpath tab click on New Library and the new small dialog box will open.
4. Type Library name as JoGl2.0 and click on the OK button.
5. Press Add JAR/Folder button.
6. Select the path where all 4 .jar files are located. Click on the Ok button.
7. These .jar files must be available to each project. For that right-click on the project, click on Properties. Select Libraries from the left-hand corner, Click on Compile tab then click on Add Library button and add the JOGL2.0 library.
In this way, you can set up and configure JOGL in any Java IDE to use its features.