• Post Reply Bookmark Topic Watch Topic
  • New Topic

NoClassDefFoundError: javax/mail/Message  RSS feed

 
Sam Walker
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I�m trying to test a simple program to send an email out. I�m using XP and when I issues
java mypackage.myprogram
I get NoClassDefFoundError. I changed my classpath to point to the directory where the jar files are, Pop3.jar, smtp.jar, activation.jar, mail.jar. And I have the current direcoty in the classpath.
As far as I know this should do it, except that it doesn't, so what is wrong? The last time I had this problem it was due to mismatch in versions of the libraries; I had compiled my program with one version of jdk and the jar was from an entirely incompatible version. But I downloaded this stuff not even two months ago from Sun�s web site.
Any ideas what is causing this?
Thanks in advance.
 
John Lee
Ranch Hand
Posts: 2545
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi:
Here are some links, hope they help.
link
link
link
link
link
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Couple of things. Could you tell us what version of JAVA you are using. What is the exact error message you are getting. There may be a bit more to the NoClassDefError message than what you are posting.
Also, what does your java file look like with your main method?
 
Sam Walker
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don,
Thanks for the links I'm looking at them.

Gregg Bolinger
I'm using j2sdk1.4.1_02, jaf-1.0.2 and javamail-1.3. I think these are the last stable versions of everything.
 
John Lee
Ranch Hand
Posts: 2545
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are welcome!
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to add the jar files to the classpath.
For instance (as per the installation instructions):
CLASSPATH = C:\jaf-1.0.1\activation.jar;
CLASSPATH = %CLASSPATH%;c:\jsdk2.1\servlet.jar;
CLASSPATH = %CLASSPATH%;c:\pop3-1.1.1\pop3.jar;
CLASSPATH = %CLASSPATH%;c:\javamail-1.1.3\mail.jar;
CLASSPATH = %CLASSPATH%;c:\jdk1.2.2\lib\WML.jar;
[ June 03, 2003: Message edited by: Cindy Glass ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!