Solved

setting up java mail

Posted on 2003-11-26
5
424 Views
Last Modified: 2010-04-01
Im following the instructions at http://developer.java.sun.com/developer/onlineTraining/JavaMail/exercises/MailSetup/help.html and the error message im getting when I complete task 6 is

Exception in thread "main" java.lang.NoClassDefFoundError: msgsend

Im runnining WinXP, C:\j2sdk1.4.1_03

Task 1 - Download javamail 1.3.1
Task 2 - Download jaf-1.0.2
Task 3 - Unzip and installed in C:\javamail-1.3.1 and C:\jaf-1.0.2
Task 4 - Copied mail.jar and activation.jar to C:\j2sdk1.4.1_03\jre\lib\ext
Task 5 - javac msgsend.java
Task 6 - C:\javamail-1.3.1\demo>java msgsend -o auduin@hotmail.com -M mysmtp.com auduin@hotmail.com (mysmtp.com has been replaced here)

Also added environment variables
JAF_JAR               C:\j2sdk1.4.1_03\jre\lib\ext\activation.jar
JAVAMAIL_JAR      C:\j2sdk1.4.1_03\jre\lib\ext\mail.jar
PATH                   %JAF_JAR%;%JAVAMAIL_JAR%
CLASSPATH          C:\j2sdk1.4.1_03\jre\lib\ext\activation.jar;C:\j2sdk1.4.1_03\jre\lib\ext\mail.jar

Can anyone help? Thanks in advance.
0
Comment
Question by:auduin
  • 3
  • 2
5 Comments
 
LVL 14

Accepted Solution

by:
kennethxu earned 125 total points
ID: 9829472
make sure the currect directory is included in your classpath. or try this:
java -classpath %classpath%;. msgsend -o auduin@hotmail.com -M mysmtp.com auduin@hotmail.com
0
 

Author Comment

by:auduin
ID: 9829577
Thanks for your help again Kenneth.

That command seems to work, java -classpath %classpath%;. msgsend -o auduin@hotmail.com -M mysmtp.com auduin@hotmail.com

How do I set my system so I dont have to put -classpath %classpath%;.

0
 
LVL 14

Expert Comment

by:kennethxu
ID: 9829582
set environment var to:
CLASSPATH          .;C:\j2sdk1.4.1_03\jre\lib\ext\activation.jar;C:\j2sdk1.4.1_03\jre\lib\ext\mail.jar
0
 

Author Comment

by:auduin
ID: 9829666
Thanks again for your help. Really appreciate it.

By the way
CLASSPATH          .;C:\j2sdk1.4.1_03\jre\lib\ext\activation.jar;C:\j2sdk1.4.1_03\jre\lib\ext\mail.jar didnt work so I did
CLASSPATH          C:\javamail-1.3.1\demo;C:\j2sdk1.4.1_03\jre\lib\ext\activation.jar;C:\j2sdk1.4.1_03\jre\lib\ext\mail.jar;
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 9831249
glad to know your problem is solved.
.; means you'll have to execute the java code.class in the dir where code.class is. and you'll need to start a new DOS windows in order to take the new env setting.
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

Title # Comments Views Activity
Display current date,month,and year to JTextField 3 47
servlet cookie finding by name 1 70
doubleChar java challenge 7 102
Suggestion on WebSite Template Sites 6 82
Note: This is the second blog post in a series on email clearinghouses (https://www.xmatters.com/alert-management/blog-email-has-failed-us?utm_campaign=70138000000ydLoAAI&utm_source=exex&utm_medium=article&utm_content=blog-post).   Every month t…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

911 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

20 Experts available now in Live!

Get 1:1 Help Now