Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
dannyDog - 02 Jun 2005 15:57 GMT
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!
GaryM - 02 Jun 2005 16:54 GMT
> 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/?
dannyDog - 02 Jun 2005 17:38 GMT
Yes :)
GaryM - 02 Jun 2005 18:06 GMT
> Yes :)

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.
dannyDog - 02 Jun 2005 19:43 GMT
That solved it - thanks!


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.