Solved

Help with getting JavaMail to work (msgsend demo)

Posted on 2001-07-19
6
389 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

747 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

15 Experts available now in Live!

Get 1:1 Help Now