java.lang.NoClassDefFoundError: javax/mail/Authenticator, whats wrong?

后端 未结 6 766
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-28 14:09

Send to Email.java

package helper;

//Mail.java - smtp sending starttls (ssl) authentication enabled
//1.Open a new Java class in netbeans (         


        
6条回答
  •  天命终不由人
    2020-11-28 14:38

    When I had this problem, I had included the mail-api.jar in my maven pom file. That's the API specification only. The fix is to replace this:

    
    javax.mail
    javax.mail-api
    

    with the reference implementation of that api:

    com.sun.mail
    javax.mail
    

    I know it has sun in the package name, but that's the latest version. I learned this from https://stackoverflow.com/a/28935760/1128668

提交回复
热议问题