Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/Lin

Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/LineInputStream
	at javax.mail.Session.loadProvidersFromStream(Session.java:928)
	at javax.mail.Session.access$000(Session.java:174)
	at javax.mail.Session$1.load(Session.java:870)
	at javax.mail.Session.loadResource(Session.java:1084)
	at javax.mail.Session.loadProviders(Session.java:889)
	at javax.mail.Session.<init>(Session.java:210)
	at javax.mail.Session.getInstance(Session.java:249)
	at com.pdt.util.EmailUtil.sendMail(EmailUtil.java:98)
	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

你可能感兴趣的:(java发邮件,java发邮件报错)