Java代码 Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/Lin _com Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/Lin _com_02

  1. Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/LineInputStream
  2. at javax.mail.Session.loadProvidersFromStream(Session.java:928)
  3. at javax.mail.Session.access$000(Session.java:174)
  4. at javax.mail.Session$1.load(Session.java:870)
  5. at javax.mail.Session.loadResource(Session.java:1084)
  6. at javax.mail.Session.loadProviders(Session.java:889)
  7. at javax.mail.Session.<init>(Session.java:210)
  8. at javax.mail.Session.getInstance(Session.java:249)
  9. at com.pdt.util.EmailUtil.sendMail(EmailUtil.java:98)
  10. at com.pdt.util.EmailUtil.main(EmailUtil.java:137)

这是javamail发送报的错,主要是因为使用myeclipse工具导致

解决办法是:用rar打开X:/Program Files/MyEclipse 6.0/myeclipse/eclipse/plugins/com.genuitec.eclipse.j2eedt.core_6.0.1.zmyeclipse601200710/data/libraryset/EE_5/javaee.jar

,然后删除mail,一切就ok了.

不解决可以qq:443628678