Solved

Help with getting JavaMail to work (msgsend demo)

Posted on 2001-07-19
6
393 Views
Last Modified: 2013-11-24
Hi there,
I pretty new to Java and that so if I ask a stupid question please bear with me.

I have jdk1.3.1 running and it appears to working corectly (running NT with the only classpath set to 'jdk\bin\'). I have downloaded JavaMail1.2 and JAF1.0.1 and extracted them, placing all the JAR out of the zip files in my '\jdk\jre\lib\ext\' directory.

After that I went to the 'demo' directory in Javamail and compiled the msgsend.java file.

When I try and run the msgsend class file (with the -o & -M switches included), I get the following error:

'Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/Message

I have looked about for a day now and cannot find an answer to my problem. Can someon please help me?

Thanks in advance

David Eilloc
0
Comment
Question by:eilloc
  • 4
  • 2
6 Comments
 
LVL 1

Expert Comment

by:mjsmith99
ID: 6301154
Hi eilloc,

I think your problem is either because your CLASSPATH is wrong or because you have not installed the Java Activation Framework.

On my PC I have :

CLASSPATH=.;d:\jdk\lib;d:\jdk\jre\lib;d:\jmail\mail.jar;d:\jdk\jre\lib\ext\activation.jar

I downloaded the JAF and then placed activation.jar in the indicated directory.  Your directory placement is probably different to mine.

Hope it helps,
mjsmith99 at hotmail.youknowwhat

0
 

Author Comment

by:eilloc
ID: 6301447
Thanks for that mjsmith99, but it hasn't worked.

Still getting the 'Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/Message' error.

The tic-tac-toe works to test the JDK but this first demo for JAvaMail will not.

I have placed my activation.jar in the lib folder of the JDK's JRE and the JAvaMail mail.jar in it's own folder within the jdk.  All are referenced correctly and my CLASSPATH is set as:

PATH=".;C:\jdk\lib;C:\jdk\javamail-1.2\mail.jar;C:\jdk\jre\lib;C:\jdk\jre\lib\ext\activation.jar"

I have also had it as

PATH=".;C:\jdk\bin;C:\jdk\javamail-1.2\mail.jar;C:\jdk\jre\lib;C:\jdk\jre\lib\ext\activation.jar"

Any other suggestions would be greatly appreciated

Thanks

eillloc

0
 

Author Comment

by:eilloc
ID: 6311851
I'm getting pretty desperate, anybody out there help me?
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 1

Accepted Solution

by:
mjsmith99 earned 200 total points
ID: 6321054
Hi eilloc,

Your message shows the PATH variable.  You need to set CLASSPATH, not PATH.

Regards,
Mike
0
 

Author Comment

by:eilloc
ID: 6323097
Hi Mike,

Bit busy the now, but thanks for replying, will try out your method and get back to ya.  I'm not ignoring it, just a bit swamped.

Cheers,

Dave
0
 

Author Comment

by:eilloc
ID: 6530537
Did not exactly solve the problem, but near enough.  Gave me good pointers in solving it.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now