Installing and Configuring OpenGL for Java (JOGL) on NetBeans ...

harmonyashamedSoftware and s/w Development

Jun 5, 2012 (5 years and 12 days ago)

1,547 views

Installing and Configuring OpenGL for Java (JOGL) on NetBeans 6.9.x IDE
Vamsikrishna Gopikrishna
Required Downloads
 Get Java JDK 6 Update 23 (https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-
CDS_Developer-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=jdk-6u23-oth-
JPR@CDS-CDS_Developer
)
 Get the JOGL 2.0 Library (http://jogamp.org/deployment/autobuilds/rc/jogl-b18-2010-12-
14_23-00-56/
jogl-2.0-b18-20101215-<os>-<environment>.zip)
 [Optional] Get the JOGL 2.0 Javadoc for the corresponding build
(http://jogamp.org/deployment/autobuilds/rc/jogl-master-b12-2010-12-14_23-00-
18/javadoc.zip
)
 Get NetBeans IDE (http://netbeans.org/downloads/index.html
)
Setup
1.Install Java JDK 6 Update 23
2.Add Java Bin Directory to system path
 Windows 7/Vista
i.Start  Computer  ‘System Properties’ or Control Panel  ‘System and
security’  System or Right click ‘Computer’ and select ‘Properties’
ii.Click ‘Advanced system settings’
iii.Go to ‘Advanced’ Tab and click ‘Environment Variables…’
iv.Find environment variable titled PATH (Maybe in both System and User
variables) and click edit
v.Append ‘<drive>:\<java installation folder>\bin;’ to the beginning and hit Ok
 Windows XP
i.Right Click on My Computer and select ‘Properties’
ii.Go to ‘Advanced’ Tab and click ‘Environment Variables…’
iii.Find environment variable titled PATH (Maybe in both System and User
variables) and click edit
iv.Append ‘<drive>:\<java installation folder>\bin;’ to the beginning and hit Ok
 Linux
i.Type echo $PATH in terminal to check if Java already in path
ii.If not add the following lines to $HOME/.bashrc (If you use a bash shell) or
$HOME/.profile (If you use a ksh or sh shell):
o PATH=$PATH:/<full java installation path>/bin
o export PATH
iii.Relog or execute the instructions in the Terminal for changes to take effect
 Mac-OSX
i.Edit the following line to the .profile file in your home directory
o export PATH=/<full java installation path>/bin:<previously existing text>
3.Install NetBeans 6.9
4.Unzip JOGL 2.0 and (Optional) JOGL 2.0 JavaDoc
5.Start NetBeans.
6.Click Tools  Libraries
7.Click New and give name ‘JOGL-2.0’.
8.Add the JOGL JAR’s
 Select the ‘Classpath’ tab and Click ‘Add JAR/Folder…’
 Navigate to sub-folder ‘jar’ in folder where you extracted JOGL 2.0
 Select the following JARs: gluegen-rt.jar, jogl.all.jar, nativewindow.all.jar, newt.all.jar
 Click ‘Add JAR/Folder’ to add them to your library
9.(Optional) We can add the JOGL JavaDoc if needed.
 Select the ‘Javadoc’ tab and Click ‘Add ZIP/Folder…’
 Select sub-folder ‘javadoc’ in folder where you unzipped JOGL 2.0 JavaDoc.
 Click ‘Add ZIP/Folder’
10.Click OK to finish
11.Adding JOGL to project
 After Creating New Project, Right click libraries and select ‘Add Library’
 Select JOGL and click ‘Add Library’
 Right click Project Name in list of projects and select ‘Properties’
 Select Category ‘Run’
 Change VM Options to: -Djava.library.path="<folder where jogl is unzipped>\lib"
 Click OK to finish
NOTE: For 64Bit Windows 7 users, I would recommend just getting the 32 bit versions of everything.