Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Strange NoClassDefFound:java not finding class but javap finding it

843810Jul 2 2001 — edited Jul 31 2001
I have installed mail.jar and activation.jar in JAVA_HOME/jre/lib/ext which should automatically be on the classpath.

I have a file TransportSendExample.java that imports classes from these jar files.

If I run: javac TransportSendExample.java
It works no problem.

I then try: java TransportSendExample
And I get: Exception in thread "main" java.lang.NoClassDefFoundError: javax.mail.Address

So I try this to see if javap works:
javap javax.mail.Address
And I get everything I would expect:

public abstract class javax.mail.Address extends java.lang.Object
{
//all the methods
}
i.e. javap locates the class.

So what is happening. I cannot see how this could be a classpath problem since javap locates the class.

Any advice would be greatly appreciated.

Tim.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 28 2001
Added on Jul 2 2001
7 comments
364 views