Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Exception in thread "main" java.lang.NoClassDefFoundError: javax/media/opengl/GLEventListener

14 views
Skip to first unread message

Jon Harrop

unread,
Oct 10, 2007, 3:48:55 AM10/10/07
to

I'm trying to run the JOGL demos and I get this:

$ cd jogl-demos
$ java -cp ../jogl/build/jogl.jar -cp ../jogl/build/gluegen-rt.jar -cp
build/jogl-demos.jar demos.gears.Gears
Exception in thread "main" java.lang.NoClassDefFoundError:
javax/media/opengl/GLEventListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

What does that mean and how can I fix it?

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com/products/?u

Andrew Thompson

unread,
Oct 10, 2007, 5:39:28 AM10/10/07
to
Jon Harrop wrote:
..

>$ cd jogl-demos
>$ java -cp ../jogl/build/jogl.jar -cp ../jogl/build/gluegen-rt.jar -cp
>build/jogl-demos.jar demos.gears.Gears

Try adding all the jars usings a single -cp attribute..
java -cp ../jogl/build/jogl.jar;../jogl/build/gluegen-rt.jar;build/jogl-demos.
jar demos.gears.Gears

--
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via http://www.javakb.com

Jon Harrop

unread,
Oct 10, 2007, 5:40:49 AM10/10/07
to
Andrew Thompson wrote:

> Jon Harrop wrote:
>>$ cd jogl-demos
>>$ java -cp ../jogl/build/jogl.jar -cp ../jogl/build/gluegen-rt.jar -cp
>>build/jogl-demos.jar demos.gears.Gears
>
> Try adding all the jars usings a single -cp attribute..
> java -cp
> ../jogl/build/jogl.jar;../jogl/build/gluegen-rt.jar;build/jogl-demos. jar
> demos.gears.Gears

That gives me the same as without setting the CLASSPATH at all:

$ java -cp "../jogl/build/jogl.jar;../gluegen/build/gluegen-rt.jar;
build/jogl-demos.jar" demos.gears.Gears
Exception in thread "main" java.lang.NoClassDefFoundError: demos/gears/Gears

Is the same result as:

$ java demos.gears.Gears
Exception in thread "main" java.lang.NoClassDefFoundError: demos/gears/Gears

Gordon Beaton

unread,
Oct 10, 2007, 6:06:53 AM10/10/07
to
On Wed, 10 Oct 2007 10:40:49 +0100, Jon Harrop wrote:
> That gives me the same as without setting the CLASSPATH at all:
>
> $ java -cp "../jogl/build/jogl.jar;../gluegen/build/gluegen-rt.jar;
> build/jogl-demos.jar" demos.gears.Gears
> Exception in thread "main" java.lang.NoClassDefFoundError: demos/gears/Gears

Except that on Unix or Linux, separate entries with colon ":" (not
semicolon ";" which is AFAIK specific to Windows).

It isn't necessary to quote the classpath argument. I suspect you were
forced to because of the ";" characters, which have a special meaning
to your shell.

/gordon

--

Andrew Thompson

unread,
Oct 10, 2007, 7:12:59 AM10/10/07
to
Gordon Beaton wrote:
>> That gives me the same as without setting the CLASSPATH at all:
>>
>> $ java -cp "../jogl/build/jogl.jar;../gluegen/build/gluegen-rt.jar;
>> build/jogl-demos.jar" demos.gears.Gears
>> Exception in thread "main" java.lang.NoClassDefFoundError: demos/gears/Gears
>
>Except that on Unix or Linux, separate entries with colon ":" (not
>semicolon ";" which is AFAIK specific to Windows).
..

I thought that prompt looked 'odd'. ;-)

Jon Harrop

unread,
Oct 10, 2007, 10:01:13 AM10/10/07
to

Oh my God! I managed to get it working thanks to this! Only thing missing
was LD_LIBRARY_PATH. Thank you so much! If you were a girl I'd kiss you...

0 new messages