Solved

Help with getting JavaMail to work (msgsend demo)

Posted on 2001-07-19
6
404 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
Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

 
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 Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
tomcat administrtor 12 68
login form jsp example 2 50
Eclipse with various Java releases 7 47
Find out all repos that a user is most active on Github 1 29
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…
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 …
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:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

756 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