Java email error

I am getting the following error when trying to send email from java:

0272     EXE.CMD := 'java -jar ./EMAIL/lib/sendmail.jar ./EMAIL/':TIMET
jBASE debugger->S
0273     EXECUTE EXE.CMD
jBASE debugger->S
Exception in thread "main" java.lang.NoClassDefFoundError: javax/activation/DataSource
0274     EXE.CMD = 'DELETE ':FILE.PATH:' ':TIMET
jBASE debugger->

Please help
bandiraviAsked:
Who is Participating?
 
CEHJCommented:
You need to put activation.jar in your classpath
0
 
ksivananthCommented:
add activation.jar file to the classpath
0
 
objectsCommented:
you need jaf jar in your classpath
can download it here

http://java.sun.com/javase/technologies/desktop/javabeans/jaf/downloads/index.html
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
objectsCommented:
once you've downloaded the jar from the above link you'll then need to either change the manifest in sendmail.jar to specify jaf location or change your command line  

java -classpath ./EMAIL/lib/sendmail.jar;./EMAIL/lib/activation.jar ./EMAIL/

0
 
bandiraviAuthor Commented:
I am still getting the same error. I am a novice to JAVA and how do I confirm the settings are done properly.
0
 
objectsCommented:
did you change the command line or update the manifest as I explained above?
0
 
CEHJCommented:
In this case, it will be easiest to put activation.jar in the lib\ext directory of your Java runtime
0
 
CEHJCommented:
If there's any doubt about where your lib\ext is/are, place this as the first line of main() and it will tell you
System.out.println(System.getProperty("java.ext.dirs"));

Open in new window

0
 
enggagrawalCommented:
before u run java command
execute if ur activation.jar exist in c:/




set classpath="c:/activation.jar"

Open in new window

0
 
bandiraviAuthor Commented:
I copied all the jar files to the location and it worked fine
0
 
CEHJCommented:
Don't forget ksivananth - on my web page it shows he answered first, and correctly
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.