无法使用 mailR 包发送电子邮件
我得到下面提到的错误。我将 mail.jar, activation.jar, mailapi.jar, common-lang3.jar 复制到 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext
java.lang.NoClassDefFoundError: javax/activation/DataHandler
at org.apache.commons.mail.Email.createMimeMessage(Email.java:1832)
at org.apache.commons.mail.Email.buildMimeMessage(Email.java:1268)
at org.apache.commons.mail.Email.send(Email.java:1436)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at RJavaTools.invokeMethod(RJavaTools.java:386)
Caused by: java.lang.ClassNotFoundException
at RJavaClassLoader.findClass(RJavaClassLoader.java:383)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:566)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
... 8 more
NULL
Error: NoClassDefFoundError (Java): javax/activation/DataHandler