java.lang.NoClassDefFoundError: javax.activation.DataHandler in android

Viewed 28117

I am making a email sending application in android phone. For that I included two jar file activation. jar and mail.jar. But when I run this application and try to send the mail, I got following error on LogCat.

java.lang.NoClassDefFoundError: javax.activation.DataHandler 

I am new to android. so I am not able to figure out this issue. please Help me. Thanks

3 Answers

If you are Build an E-mail sender java AWT app or Android App you need to use 3 jar files:

  • activation.jar (which contain classes like Mime.class)
  • javax_mail.jar (which contain classes like like Session.class)
  • additional.jar (which contain awt files)

Link : https://code.google.com/archive/p/javamail-android/downloads

I am commenting on this stuff because I struggled too hard with this java.lang.NoClassDefFoundError.javax.activation.DataHandler while creating my java mail_sender app, and then I found that I missed to add additional jar file.

Related