Reputation: 31
I have installed java on Windows (64-bit). My question is: how do I install Javamail my PC? I used this way to create classpath %classpath%;c:\....
ect. but does not work still. I get the have error
The import javax.mail cannot be resolved
Upvotes: 2
Views: 11000
Reputation: 7613
To install Javamail you should have a look at the ReadMe. Which states:
Note that the JavaMail API requires the JavaBeans(TM) Activation Framework package to be installed as well if you're using JDK 1.5 or earlier. Download the latest version of the JavaBeans Activation Framework from
http://www.oracle.com/technetwork/java/javase/index-jsp-136939.html
and install it in a suitable location.
And
Unzip the javamail1_4_5.zip archive. (You may have already done this.)
Set your CLASSPATH to include the "mail.jar" file obtained from the download, as well as the current directory.
Assuming you unzipped javamail1_4_5.zip in c:\download the following would work:
set CLASSPATH=%CLASSPATH%;c:\download\javamail-1.4.5\mail.jar;.
Also, if you're using JDK 1.5 or earlier, include the "activation.jar" file that you obtained from downloading the JavaBeans Activation Framework, in your CLASSPATH.
set CLASSPATH=%CLASSPATH%;c:\download\activation\activation.jar
Go to the demo directory
Compile any demo using your Java compiler. For example:
javac msgshow.java
Run the demo. The '-' option lists the required and optional command-line options to successfully run any demo. For example:
java msgshow -
lists the available options. And
java msgshow -T imap -H -U -P -f INBOX 5
uses the IMAP protocol to display message number 5 from your INBOX.
Upvotes: 1