Solved

Help with getting JavaMail to work (msgsend demo)

Posted on 2001-07-19
6
406 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
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

710 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