auduin
asked on
setting up java mail
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.NoClassDefFoundE rror: 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\e xt
Task 5 - javac msgsend.java
Task 6 - C:\javamail-1.3.1\demo>jav a 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\e xt\activat ion.jar
JAVAMAIL_JAR C:\j2sdk1.4.1_03\jre\lib\e xt\mail.ja r
PATH %JAF_JAR%;%JAVAMAIL_JAR%
CLASSPATH C:\j2sdk1.4.1_03\jre\lib\e xt\activat ion.jar;C: \j2sdk1.4. 1_03\jre\l ib\ext\mai l.jar
Can anyone help? Thanks in advance.
Exception in thread "main" java.lang.NoClassDefFoundE
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\e
Task 5 - javac msgsend.java
Task 6 - C:\javamail-1.3.1\demo>jav
Also added environment variables
JAF_JAR C:\j2sdk1.4.1_03\jre\lib\e
JAVAMAIL_JAR C:\j2sdk1.4.1_03\jre\lib\e
PATH %JAF_JAR%;%JAVAMAIL_JAR%
CLASSPATH C:\j2sdk1.4.1_03\jre\lib\e
Can anyone help? Thanks in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
set environment var to:
CLASSPATH .;C:\j2sdk1.4.1_03\jre\lib \ext\activ ation.jar; C:\j2sdk1. 4.1_03\jre \lib\ext\m ail.jar
CLASSPATH .;C:\j2sdk1.4.1_03\jre\lib
ASKER
Thanks again for your help. Really appreciate it.
By the way
CLASSPATH .;C:\j2sdk1.4.1_03\jre\lib \ext\activ ation.jar; C:\j2sdk1. 4.1_03\jre \lib\ext\m ail.jar didnt work so I did
CLASSPATH C:\javamail-1.3.1\demo;C:\ j2sdk1.4.1 _03\jre\li b\ext\acti vation.jar ;C:\j2sdk1 .4.1_03\jr e\lib\ext\ mail.jar;
By the way
CLASSPATH .;C:\j2sdk1.4.1_03\jre\lib
CLASSPATH C:\javamail-1.3.1\demo;C:\
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.
.; 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.
ASKER
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%;.