JAVA:MAIL:我如何解决ClassNotFoundException:javax.mail.internet.AddressException?

时间:2015-02-06 05:43:37

标签: java email

我有一些代码可以发送电子邮件,它在我的系统中运行良好。但问题是我将此程序复制到另一个系统,并在运行时出现以下错误。

ClassNotFoundException : javax.mail.internet.AddressException

注意:两个系统都是Windows 7

错误

Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/internet/AddressException
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
    at java.lang.Class.getMethod0(Unknown Source)
    at java.lang.Class.getMethod(Unknown Source)
    at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
    at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException:javax.mail.internet.AddressException

    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 6 more   

1 个答案:

答案 0 :(得分:1)

您的依赖jar文件似乎未下载或与您的依赖项存在冲突。

javax.mail.internet.AddressException找到javax.mail-1.4.x.jar

您可以发布图书馆列表或您的依赖项吗?