Setting up Your Development Environment

If you downloaded and installed the J2EE reference implementation, you are ready to start exploring the JavaMail API. If you did not install the reference implementation, you will need to install the JavaMail API and Java Activation Framework (JAF) before you can start writing code.

Before you download the JavaMail API, ensure that you have J2SE 1.2.X or later correctly installed. You must also install the Java Activation Framework (JAF) because the JavaMail API requires it. The API requires the framework to handle arbitrary large blocks of data (you will learn more about this later in today's lesson). You can download JAF from http://java.sun.com/products/javabeans/glasgow/jaf.html.

Note

Both JAF and the JavaMail API are written in pure Java, so they will operate on any platform running JDK 1.1 or later.


After you have downloaded the framework, installation is straightforward. Simply unzip the download file and append the location of activation.jar to your class path. To do this on a Windows platform, issue the following command:

set CLASSPATH=%CLASSPATH%;C:jaf-VERSIONactivation.jar

On a Unix-based system that has a Bourne or Korn shell, use the following:

$CLASSPATH=$CLASSPATH:usr/java/jaf-VERSION
$export $CLASSPATH

You have now installed JAF; now download the JavaMail API from http://java.sun.com/products/javamail/index.html. When downloaded, the actual installation of JavaMail is as simple as installing JAF. Simply unzip the download file and append the location of mail.jar to your class path.

That's it! You have successfully installed the JavaMail API. You will find a selection of demonstration applications in the demo directory under the JavaMail installation directory. In addition, you can find the API documentation in the javadocs directory, which is also under the installation directory.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.189.67