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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ksivananthCommented:
add activation.jar file to the classpath
0
CEHJCommented:
You need to put activation.jar in your classpath
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mick BarryJava DeveloperCommented:
you need jaf jar in your classpath
can download it here

http://java.sun.com/javase/technologies/desktop/javabeans/jaf/downloads/index.html
0
Learn SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Mick BarryJava DeveloperCommented:
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
Mick BarryJava DeveloperCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.