How can I set classpath for extensions (such as JavaMail API) on Linux?

Nathan Meyers

With the Java 2 platform, you can install extension jarfiles into a directory meant to contain extensions. For the SDK, this is the jre/lib/ext subdirectory of the SDK installation, and for the JRE it's the lib/ext subdirectory of the JRE installation.

Another option is to add the jarfile to the classpath, either with the java -classpath option or with the CLASSPATH environment variable.