Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.NoClassDefFoundError: javax/mail/Address error

Tags:

java

eclipse

jar

I have my project with the mail.jar in the lib folder. I created a manifest file as

Manifest-Version: 1.0
Main-Class: mainfile
Class-Path: lib/mail.jar

I then exported the jar file using eclipse.

I tried executing the jar file now as java -jar myjar.jar and I get the error

java.lang.NoClassDefFoundError: javax/mail/Address

Any pointers would be greatly appreciated

like image 511
stackuser Avatar asked Sep 10 '25 02:09

stackuser


1 Answers

  1. Add mail.jar in your class path.
  2. Make sure there is no typo in your class path.
  3. Check exported jar file, is all required jar are came there if not you have to use eclipse option Extract required libraries into generated JAR.
like image 77
atish shimpi Avatar answered Sep 12 '25 20:09

atish shimpi