Solved

setting up java mail

Posted on 2003-11-26
5
433 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
[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
  • 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

Technology Partners: 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

Suggested Solutions

Title # Comments Views Activity
unit test DAO layer 1 150
instanceof  operator in java 26 114
running on tomcat not jboss eap 7.0 3 55
JVM error from eclipse 1 27
Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

751 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