Can't find class java.lang.NoClassDefFoundError. (Wrong class path?)

Can't find class java.lang.NoClassDefFoundError. (Wrong class path?)

Post by qazm » Sat, 12 Jul 2003 00:48:15



While creating JVM, I am getting the following error:
Can't find class java.lang.NoClassDefFoundError. (Wrong class path?)

I gave all the required Jar files in the CLASSPATH. Also, I set the
LD_LIBRARY_PATH such that, it can pick up libjvm.so available at:
/usr/java1.2/jre/lib/sparc/libjava.so

All these did not solve the problem at all.

How do I proceed ? So far, I spent 15 hours without arriving at any
solution.
Could you help?

Thanks!

 
 
 

Can't find class java.lang.NoClassDefFoundError. (Wrong class path?)

Post by dhek bhun kh » Sat, 12 Jul 2003 00:56:12


Hi


Quote:> While creating JVM, I am getting the following error:
> Can't find class java.lang.NoClassDefFoundError. (Wrong class path?)

> I gave all the required Jar files in the CLASSPATH. Also, I set the
> LD_LIBRARY_PATH such that, it can pick up libjvm.so available at:
> /usr/java1.2/jre/lib/sparc/libjava.so

> All these did not solve the problem at all.

> How do I proceed ? So far, I spent 15 hours without arriving at any
> solution.
> Could you help?

> Thanks!

Wow you spent 15 hours on this? I'd go nuts and just reinstall. The class
java.lang.NoClassDefFoundError is supposed to be in the rt.jar if you
using a 'regular' Sun VM

~ $ jar tvf /opt/blackdown-jdk-1.4.1/jre/lib/rt.jar | grep NoClass
   316 Mon Jan 13 15:43:38 CET 2003 java/lang/NoClassDefFoundError.class

You shouldn't be setting the LD_LIBRARY_PATH. The default settings for the
LD_LIBRARY_PATH should be correct. It's strange that your VM doesn't pick
up the rt.jar; on my machine the Sun VM always prepends rt.jar. Or have
you have been tweaking the boot classpath settings?

Greets.
Bhun.

---

IN THE END>>> YOU SEE .. THE RING.NET

 
 
 

Can't find class java.lang.NoClassDefFoundError. (Wrong class path?)

Post by Joseph Milla » Sat, 12 Jul 2003 03:40:56



Quote:> While creating JVM, I am getting the following error:
> Can't find class java.lang.NoClassDefFoundError. (Wrong class path?)

I assume you mean you are using the Invocation API's to create
a JVM in your application?  Which version for InitArgs are you
using, 1.1 or 1.2 style?  If 1.1, what is the the classpath
field set to? If you are using 1.2, which property are you
using to set classpath, -Xbootclasspath?  Will need to see the
args setup and CreateJavaVM() call to really help here.

Quote:> I gave all the required Jar files in the CLASSPATH. Also, I set the
> LD_LIBRARY_PATH such that, it can pick up libjvm.so available at:
> /usr/java1.2/jre/lib/sparc/libjava.so

Based on the error, I guess the classpath is not what it should
be, inspite of what you say ;-).  Let's see the code.

The LD_LIBRARY_PATH is essential, it won't work properly without
it.  But that's not your problem, the JVM is trying to start so
you are past this issue (at least temporarily), but it can't find
some required classes, which means your classpath is bogus somehow.

Quote:> All these did not solve the problem at all.

> How do I proceed ? So far, I spent 15 hours without arriving at any
> solution.

Invocation API problems can be frustrating, the options are
obscure and tend not to be well documented.  Trial and error
and experience help alot here.

--Joe

 
 
 

Can't find class java.lang.NoClassDefFoundError. (Wrong class path?)

Post by Roedy Gree » Sun, 13 Jul 2003 02:05:03



wrote or quoted :

Quote:>NoClassDefFoundError

this is my most dreaded error.  It can have a multitude of causes.
see http://mindprod.com/jgloss/errormessages.html#NOCLASSDEFFOUNDERROR

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.