NoClassDefFoundError - how to handle during runtime

K

Konrad Viltersten

I have compiled a program (no errors, no warnings) but as i
try to run it i get a run-time error - NoClassDefFoundError.
I was surprised as i thouth it would occur during the
process of compiling...

So, what can i do about it? Obviously everything is in place
as i get a nice .CLASS file. What can i do to obtain more
information on what's wrong?

If it matters, i'm trying to play around with OpenGL and
i'm using JOGL. The class that is supposed not to be there
is GLEventListener. WinXP, JDK1.5.0. What can i have
forgotten in my desperation?

--

Vänligen
Konrad
---------------------------------------------------

Sleep - thing used by ineffective people
as a substitute for coffee

Ambition - a poor excuse for not having
enough sense to be lazy

---------------------------------------------------
 
R

Roedy Green

NoClassDefFoundError.

see
http://mindprod.com/jgloss/runerrormessages.html#NOCLASSDEFFOUNDERROR

You debug your code so these don't happen. If you get one in
production you need to fall on your sword. It is too late do anything
sensible. The code you need is MISSING. Unless there is some
desperate way to carry on without the code you requested, you are
hosed.

There are a few cases, usually involving classForName, where there are
natural recoveries. The JCE on discovering part of a plugin was
missing might just delete that plugin from its support list. There
still may be other vendor implementations to fall back on.
 
H

Hemal Pandya

NoClassDefFoundError.

see
http://mindprod.com/jgloss/runerrormessages.html#NOCLASSDEFFOUNDERROR
[/QUOTE]

The seventh bullet says:

Make sure you said java.exe MyClass or java.exe MyClass.java not
java.exe MyClass.class.

It seems the logical operators got swapped. java.exe MyClass.java would
give error java.lang.NoClassDefFoundError: MyClass/java. The correct
text would be:

Make sure you said java.exe MyClass not java.exe MyClass.java or
java.exe MyClass.class.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top