Exception in thread "main" java.lang.NoClassDef...

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

如果你用myEclipse进行开发的话,运行时可能会出现以下的错误:
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/LineInputStream
原因是jar包版本不统一,解决方法如下:

删除Java EE 5 Libraries/javaee.jar/mail里的包有东西.

具体方法如下:
用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了.

 

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