java.lang.NoClassDefFoundError: javax/mail/Session Eclipse 3.0.2

D

dannyDog

I'm running an app under Eclipse 3.0.2 and getting the following
runtime error:
java.lang.NoClassDefFoundError: javax/mail/Session

with the following line of code:
session = Session.getDefaultInstance(props, null);

The app compiles without a problem.

The apps' classpath follows:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path=""/>
<classpathentry exported="true" kind="lib" path="/src/bin"/>
<classpathentry exported="true" kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="lib"
path="/lib/activation.jar"/>
<classpathentry exported="true" kind="lib" path="/lib/servlet.jar"/>
<classpathentry exported="true" kind="lib" path="/lib/mail.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

The jar files necessary for the app and another accompanying app are in
project called 'lib'.
The lib project is is included in the Java Build Path for this project,
though I don't think
that is relevant.


Where else would Eclipse be looking for the mail.jar during runtime?
I've also added the location of the jar files to my system classpath
but the error still occurs.

Thanks!
 
G

GaryM

The jar files necessary for the app and another accompanying app
are in project called 'lib'.
The lib project is is included in the Java Build Path for this
project, though I don't think
that is relevant.

This might be a silly question, but does mail.jar exist in /lib/?
 
G

GaryM


Look under menu Run / option Run / <Your Program> look at the
Classpath tab and make certain the other project in added there. Also
if that fails trying adding the mail.jar to there.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,262
Messages
2,571,050
Members
48,769
Latest member
Clifft

Latest Threads

Top