I would like to user Java Mail, but when I try to import javax.mail I get package javax.mail does not exist. I am using EE5 jdk which API reference and documentation says it includes this package. What am I doing wrong???
Four answers:
TK "Snobol" Erlang
2008-06-28 16:14:21 UTC
Make sure that the mail.jar file is in your CLASSPATH environment variable. If you're doing all this from the Windows command line, you'll need something similar to:
set CLASSPATH=%CLASSPATH%;
\mail.jar;
If you're doing this in an IDE like Eclipse, add it as an external jar file in your build properties.
-------
Additional information ...
The PATH environment variable is how you tell Windows where to find executable programs (like javac).
The CLASSPATH environment variable is how you tell the Java compiler (javac) where to find classes. When you add a .jar file to the CLASSPATH, you must use the fully qualified path to the file. For example, if the location of the mail.jar file is:
c:\sun\appserver\lib\mail.jar
Then to add it to your CLASSPATH, you need to do something like:
set CLASSPATH=
%CLASSPATH%;c:\sun\appserver\lib\mail.jar
This all assumes you're running javac from the command line. If you're inside an IDE (like Eclipse), it will be different.
2016-03-17 16:48:56 UTC
Yes! call me old school but i LOVE receiving packages and letters in the mail. Siigh I never get hand written letters from the mail anymore (society is too technological) but seriously if anyone was to do that, that'd probably make my day! i love hand written sentiments :-)
2016-04-06 05:49:42 UTC
For the best answers, search on this site https://shorturl.im/awgfC
yes I love getting any mail, especially packages. Did you get yours yet?
Mike S
2008-06-26 08:40:44 UTC
you need to download jar files and include them in build pathe