I can't install JOGL and I've tried everything.

I’ve been trying to install JOGL for a few days now and I was wondering if someone could please help me with it. I’ve followed countless tutorials and have tried many different things, but still, JOGL doesn’t work. Here’s what happens when I try to compile. (Most of them are all “cannot find symbol” errors, and by symbols it means it can’t find something like “GLCapabilities”) It says: “package net.java.games.jogl does not exist.” I’ve tried everything. I’ve put things in and out of my PATH and CLASSPATH, and in and out of my JRE and JDK folders. I would just like to know what I have to do with Windows XP Professional Editiont to get JOGL to run and to be able to compile JOGL programs. And is there some quick way to test to see if everything’s working because it might be my code that’s messing it up. (I doubt it, though, no JOGL code works; I’ve tried a lot of it.) So can anybody offer some assistance? Thank you. :slight_smile:

Try if you can compile this:


import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.media.opengl.*;

public class HelloGLJPanel {
	public static void main(String args[]){
		new HelloGLJPanel();
	}
	
	public HelloGLJPanel(){
		JFrame frame = new JFrame("Hello");
			
		GLJPanel gljpanel = new GLJPanel();
		gljpanel.setPreferredSize(new Dimension(600, 480));
						
		frame.add(gljpanel);
		
		frame.addWindowListener(new WindowAdapter(){
			public void windowClosing(WindowEvent e){
				System.exit(0);
			}
		});
				
		frame.pack();
		frame.setVisible(true);
	}
}

If jogl is correctly installed, this should work, you have to use import javax.media.opengl.*; instead of net.java.games.jogl

Well, it kind of worked. I could see the border of the window, and everything else just showed up through it, like it was invisible. Then the command prompt (nope, not using an IDE) spat out a bunch of errors at me. I’ve changed things so many times, so could someone possibly tell me exactly what I have to have in my CLASSPATH and PATH variables, and in my JRE and JDK folders? Thank you.

First, you have to unpack the jogl-1.1.0-windows-i586.zip or jogl-1.1.0-windows-amd64.zip file in a seperate folder (say C:\jogl)
Then, you have to add to the PATH variabele:

;c:\jogl\lib

and to the CLASSPATH-variabele:


;c:\jogl\lib\gluegen-rt.jar;c:\jogl\lib\jogl.jar 

That should do it.

It might be interesting to read the topic: http://www.java-gaming.org/forums/index.php?topic=12817.0

Should I get the nightly build or the final release? I had 1.1.0 but then I saw (and downloaded) 1.1.1 and there seem to be releases for every month. O_o Should I choose the most recent one (I’m guessing that’s what nightly is) or the most stable one (I’m guess that’s what final release is)?

That depends on what you’re trying to do with it, i should stick to the Current release build (JSR-231 1.1.0).

Ugh, I don’t have the patience for this. It STILL doesn’t work. I’ve extracted it to C:\jogl, I’ve made sure that PATH and CLASSPATH point to those exact locations, and now the compiler says it can’t find javax.media.opengl. Do I have some kind of weird, cruel virus?

Can anyone explain what’s going on?

If you have errors, post the full console output here, since it contain hint’s what might be going wrong. Also post the directory listing of your C:\jogl (or whereever you put it) directory and the exact content of your PATH and CLASSPATH variables (using echo %PATH% and echo %CLASSPATH%). One problem might be, that if you edit the environment variables in windows via the GUI you have to logout and relogin, because otherwise the settings don’t take effect.

On a last note: try to get comfortable with an IDE (Netbeans, Eclipse, IDEA, JCreator, whatever). It might be difficult to grasp some concepts and find your way through the GUI, but it’s worth it, since it will safe you a lot of time and trouble once you mastered the hurdles. Onother note might be: give up on the MMORPG plan for the next two years :o Start with something really really simple or you will stop frustrated. Take a look into the cokeandcode tutorials: http://www.cokeandcode.com/tutorials

It works. I don’t know how, but I must’ve done something right and it works. I wanted to post it last night, but I went to bed. Thanks again for all your help, and I’ll try to use an IDE. I tried it once, but it wouldn’t compile becasue it couldn’t find one of the files it needs. But I’ll try it again. Could you recmmend a good Java IDE? Thanks.

Eclipse and Netbeans are two free IDEs. In it’s stable release versions Eclipse has more features and compiles faster and netbeans is IMHO easier to use and the overall editor speed feels a bit faster, if you install the basic version without the J2EE/WEB features. Also there is a plugin available for JOGL development which takes care of the settings to compile and run JOGL apps: http://www.java-gaming.org/forums/index.php?topic=12530.45 (please use netbeans 5.5 and the current jogl template linked in the first post, not the opengl pack version, which is in still in development and NB 6.X only)