Help newbie with JOGL and eclipse

Hi,

I’am a developer, i work before with c++ and i’m introducing in java and i have a little problem to solve:

i’ts the first time using eclipse and java, and i confused and lost xD i need any can tell me how configure the classpath in eclipse, why i’m trying to compile the Test.java what is here, in the how to post, and throw me some errors why cant import “import net.java.games.jogl.*;”

here is the code:


import net.java.games.jogl.*;

import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public class Test
{
    public static void main( String[] args )
    {
        try
        {
            Frame testFrame = new Frame("TestFrame");
            testFrame.setSize( 512, 384 );

            GLCapabilities glCaps = new GLCapabilities();
            glCaps.setRedBits(8);
            glCaps.setBlueBits(8);
            glCaps.setGreenBits(8);
            glCaps.setAlphaBits(8);

            GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas( glCaps );

            testFrame.add( canvas );

            canvas.addGLEventListener(new TestRenderer());

            final Animator animator = new Animator( canvas);
            testFrame.addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                  animator.stop();
                  System.exit(0);
                }
              });
            testFrame.show();
            animator.start();
        }
        catch( Exception e )
        {
            e.printStackTrace();
        }
    }
}  

i’m using ubuntu linux and 1.6 jre.

i’m gratefully if any can guide me in this java world ;D

By Shadow

di you check your lib path for JoGL.jar in it? ???

To configure the classpath, you can right click on the project and select properties. Go to the build path option, there you can add all sorts of paths for your classpath. You’ll probably want to add the jogl.jar file in the libraries sub section (I don’t have eclipse up, might be called something else, but just click (add jar) or (add external jar)). Also make sure to edit the jar’s native library path, too, since jogl depends on that.

You seem to have an example for an older release of jogl, prior to the JSR version. Since it is now “officially” an extension, it has a new package name. It’s now “javax.media.opengl” instead of “net.java.games.jogl”, there are some other changes described here. Generally there is useful informations provided in the sticky topics on top of the jogl forum.

Best would be to start from the “Gears” example in the jogl-demos source code, available from here

If you still have problems setting the environment up, have a look at this thread