Solved

Help with getting JavaMail to work (msgsend demo)

Posted on 2001-07-19
6
412 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
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

Interactive Way of Training for the AWS CSA Exam

An interactive way of learning that will help you visualize core concepts so that you can be more effective when taking your AWS certification exam.  Built for students by a student to help them understand the concepts that they are being taught.

Question has a verified solution.

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

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
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 learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
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:
Suggested Courses

623 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