For Programmers: Free Programming Magazines  


Home > Archive > Java Help > August 2005 > NoClassDefFoundError - how to handle during runtime









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author NoClassDefFoundError - how to handle during runtime
Konrad Viltersten

2005-08-23, 7:01 pm

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

---------------------------------------------------

Roedy Green

2005-08-23, 7:01 pm

On Tue, 23 Aug 2005 23:55:27 +0200, "Konrad Viltersten"
<tmp1@viltersten.com> wrote or quoted :

> NoClassDefFoundError.


see
http://mindprod.com/jgloss/runerror...SSDEFFOUNDERROR

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.

--
Canadian Mind Products, Roedy Green.
http://mindprod.com
Hemal Pandya

2005-08-26, 7:57 am

> On Tue, 23 Aug 2005 23:55:27 +0200, "Konrad Viltersten"
> <tmp1@viltersten.com> wrote or quoted :
>
>
> see
> http://mindprod.com/jgloss/runerror...SSDEFFOUNDERROR
>


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.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com