File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes java.lang.NoClassDefFoundError: javax/mail/Address Exception when sending a mail from Eclipse? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "java.lang.NoClassDefFoundError: javax/mail/Address Exception when sending a mail from Eclipse?" Watch "java.lang.NoClassDefFoundError: javax/mail/Address Exception when sending a mail from Eclipse?" New topic
Author

java.lang.NoClassDefFoundError: javax/mail/Address Exception when sending a mail from Eclipse?

Kushi Gadiparthi
Ranch Hand

Joined: Sep 23, 2010
Posts: 52
Hi All,

I want to send a mail from Eclipse.

I had added the mail.jar in the library.

But still I am getting the following error



The JavaX has been added in the User Libraries of Eclipse it has following Jars
javax-wsdl-1.5.1.jar
jaxrpc.jar
mail.jar
saaj.jar

and my code looks as follows




So Please help me to solve the above error

Thanks in Advance,

Jashvika
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36486
    
  16
Which folder is that java mail .jar in?
How are you setting the classpath for your application?
When I Googled for Java Mail, I found a download page where Message appears to be in mail.jar. Please confirm you have got that mail.jar file in the classpath as well.
Kushi Gadiparthi
Ranch Hand

Joined: Sep 23, 2010
Posts: 52
Hi,

Thanks for the Reply. I had added this jar in the eclipse --> preferences-->java-->BuildPath-->classpath variables.


But still no use, getting the same message.


Thanks in Advance.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
Build path and runtime path are different things; both need all jar files.


Ping & DNS - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.NoClassDefFoundError: javax/mail/Address Exception when sending a mail from Eclipse?
 
Similar Threads
Problem (Exception) while integrate SIP into OSGi Framework
SecurityException while sending to gmail from javamail
Applet Axis Client Errors
easiest way to send an email from a java program?
Applet freezes with itext