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 A JavaMail exception, can you explain? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Reply Bookmark "A JavaMail exception, can you explain?" Watch "A JavaMail exception, can you explain?" New topic
Author

A JavaMail exception, can you explain?

Mark Lau
Ranch Hand

Joined: Dec 15, 2001
Posts: 120
I was testing the following JavaMail code. The compile is successful, but when I run it like
java SendMailEx smtp.myuniv.edu myemail@hotmail.com myfriendsemail@yahoo.com
I got the following exception:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/Address
What does this mean? And what is the problem? Thanks.
// The code is attached here.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 11862
It means what it says - for some reason it can't find the Address class. Possibly a problem with Classpath. What environment did you compile it in?
Bill


Java Resources at www.wbrogden.com
Mark Lau
Ranch Hand

Joined: Dec 15, 2001
Posts: 120
I compiled it under W2k Professional. I just copied the mail.jar and activiation.jar files from the tomcat directory to JDK_HOME\jre\lib\ext. Is this fine?
 
 
subject: A JavaMail exception, can you explain?
 
Threads others viewed
to send an email from a servlet
Error In Sending Mail To Yahoo???Got Exception About Pop Authentication While sending
JavaMail AuthenticationFailedException
NoClassDefFoundError JavaMail..........
Not able to run JavaMail class
developer file tools