File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes javamail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "javamail" Watch "javamail" New topic


Sankar Subbiramaniam
Ranch Hand

Joined: Oct 03, 2000
Posts: 116
I downloaded JavaMail and JAF. Unzipped archive file and included the mail.jar and activation jar in my classpath. Still when i compile, i am getting the error, package javax.mail and javax.mail.internet not found in internet. Am i missing anything ?
I even tried copying bothe the jar files into the directory where i have my source code and did the compilation. It failed again ? Please help.
Sankar Subbiramaniam
Ranch Hand

Joined: Oct 03, 2000
Posts: 116
Its working. I reboot my machine and did the same process. Able to compile ???
C. C. Lai

Joined: Feb 22, 2004
Posts: 1
Tomcat is a complete web server written in Java that provides support for the Servlet and JSP specifications. Tomcat is developed as a part of the Apache Jakarta Project. Both binaries and source are available from the Jakarta web site.
To run the JavaMailServlet, you must add the JavaMail and JavaBeans Activation Framework jar files to the lib directory under the directory in which you installed Tomcat. This will cause Tomcat to include these jar files in its classpath automatically. (Some packages of Tomcat version 4 include JavaMail support.) Depending on the version of Tomcat used, the mail.jar and activation.jar files should be copied to the lib directory or to an appropriate subdirectory of the lib directory.
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
incorrect advise above!
It used to be correct but since Tomcat 4 all libraries should be specific per web app and not stored at server level.
Mind that there is a bug in Tomcat 4.0x that can cause leakage between web applications and jars in the server lib directory. This can cause the server to fail to start properly if you have for example a newer version of Xerces in a webapp lib path, but this is specifically NOT correct behaviour.

I agree. Here's the link:
subject: javamail
It's not a secret anymore!