[beginner]Cannot run

Hi i have problem with running jogl bytecodes

i have been following this thread

http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=jogl;action=display;num=1060434814

and copied

dlls in windows/system32
jar in jdk/jre/lib/ext

Exception

the result is that i can now compile(“javac whatever.java”), but i cannot “java whatever”

it gives an exception in thread “main” java.lang.NoClassDefFoundError :net/java/games/jogl/GLEventListener…etc

i have test it with a helloworld and i can ensure everything is working

any help would be appreciated

the code i compiled with are

/**

  • This is a short demo illustrating the basic structure
  • of a JOGL application. It corresponds to the first
  • attempt example from Hill
    */

import java.awt.;
import java.awt.event.
;
import net.java.games.jogl.*;

public class firstAttempt extends Frame implements GLEventListener{

public firstAttempt() {
  GLCapabilities caps = new GLCapabilities();
  
  GLCanvas canvas =
      GLDrawableFactory.getFactory().createGLCanvas(caps);


  canvas.addGLEventListener(this);
  
  add("Center", canvas);
  setSize(400,300);
  show();
}


public static void main( String args[]) {
  firstAttempt frame = new firstAttempt();
  
  //exit if frame's close box is clicked
  frame.addWindowListener( new WindowAdapter() {
      public void windowClosed(WindowEvent e){
        System.exit(0);
      }
        public void windowClosing(WindowEvent e) {
            windowClosed(e);
        }
      }
                     );
  
}

/* The functions below are required because we are a GLEventListener.
   We could also have put them in another class and put that class in the
   addGLEventListener method above.
 */

/**
* Executed exactly once to initialize the
* associated GLDrawable
*/

public void init(GLDrawable drawable) {

  GL gl = drawable.getGL();
  GLU glu = drawable.getGLU();
  /** 
   * Set the background colour when the GLDrawable 
   * is cleared 
   */ 
  gl.glClearColor( 1.0f, 1.0f, 1.0f, 1.0f ); //white

  /** Set the drawing colour to black */
  gl.glColor3f( 0.0f, 0.0f, 0.0f );
  gl.glPointSize(4.0f); //a 'dot' is 4 by 4 pixels
}

/**
* Executed if the associated GLDrawable is resized
*/
public void reshape(GLDrawable drawable, int x, int y, int width, int height) {
GL gl = drawable.getGL();
GLU glu = drawable.getGLU();
gl.glViewport( 0, 0, width, height );
gl.glMatrixMode( GL.GL_PROJECTION );
gl.glLoadIdentity();
glu.gluOrtho2D( 0.0, 400.0, 0.0, 300.0);
}

/** This method handles the painting of the GLDrawable */

public void display(GLDrawable drawable) {
  GL gl = drawable.getGL();
  GLU glu = drawable.getGLU();
  /** Clear the colour buffer */
  gl.glClear( GL.GL_COLOR_BUFFER_BIT );
  /** Draw some dots */ 
  gl.glBegin( GL.GL_POINTS ); 
  gl.glVertex2i( 100,50 ); 
  gl.glVertex2i( 100,130 ); 
  gl.glVertex2i( 150,130 ); 
  gl.glEnd(); 
}

/** This method handles things if display depth changes */
public void displayChanged(GLDrawable drawable,
                     boolean modeChanged,
                     boolean deviceChanged){
}

}

On my system the jdk jre is not the one pointed to by windows when I use a commandline window. I would be that your jar is in the jdk’s/lib/ext and the java executable you are using is in another jre. On my system the other jre is located in c:\program files\java\j2re1.4.2

Put the dlls not only in the jre/ext folder, but also in System32: that’s how I got jogl running on my machine as smooth as a baby’s bottom :slight_smile:
Hope this helps a bit, good luck

Thanks for all the replies

i have put all 3 files(jar and 2 dll) in everywhere

system32
jre\lib\ext
c:\program file\java\j2re1.4.2\lib\ext

and get it working

probabaly javac point to j2sdk and runtime point to c:\progra…\j2re1.4.2

i notice in control panel there are setting for choosing java runtime environment in either sdk or jre, i tried to set runtime to sdk but seems not working.

[quote]Thanks for all the replies

i have put all 3 files(jar and 2 dll) in everywhere

system32
jre\lib\ext
c:\program file\java\j2re1.4.2\lib\ext

and get it working

probabaly javac point to j2sdk and runtime point to c:\progra…\j2re1.4.2

i notice in control panel there are setting for choosing java runtime environment in either sdk or jre, i tried to set runtime to sdk but seems not working.
[/quote]
http://www.realityflux.com/abba/GoYou.gif
;D

Glad to see everything is working for ya mate, now get us some l33t demos :stuck_out_tongue: