Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (552)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  [beginner]Cannot run  (Read 2346 times)
0 Members and 1 Guest are viewing this topic.
Offline stev1337

Junior Newbie




Java games rock!


« Posted 2003-08-15 20:13:03 »

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){
   }
}

Offline GKW

Senior Member




Revenge is mine!


« Reply #1 - Posted 2003-08-15 20:18:44 »

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
Offline Java Cool Dude

Senior Member




Java forever


« Reply #2 - Posted 2003-08-15 21:35:41 »

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 Smiley
Hope this helps a bit, good luck
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline stev1337

Junior Newbie




Java games rock!


« Reply #3 - Posted 2003-08-15 22:28:34 »

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.
Offline Java Cool Dude

Senior Member




Java forever


« Reply #4 - Posted 2003-08-16 00:10:45 »

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.


Click to Play
Grin

Glad to see everything is working for ya mate, now get us some l33t demos  Tongue
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CopyableCougar4 (23 views)
2014-08-22 19:31:30

atombrot (34 views)
2014-08-19 09:29:53

Tekkerue (30 views)
2014-08-16 06:45:27

Tekkerue (28 views)
2014-08-16 06:22:17

Tekkerue (18 views)
2014-08-16 06:20:21

Tekkerue (27 views)
2014-08-16 06:12:11

Rayexar (65 views)
2014-08-11 02:49:23

BurntPizza (41 views)
2014-08-09 21:09:32

BurntPizza (31 views)
2014-08-08 02:01:56

Norakomi (41 views)
2014-08-06 19:49:38
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!