在我的项目中我使用IDE IntelliJ,我添加了库JDOM2。当我通过IDE运行程序时它工作正常,但是当我构建artificat时,我收到错误:
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.reflect.misc.Trampoline.invoke(Unknown Source)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.reflect.misc.MethodUtil.invoke(Unknown Source)
at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1769)
... 48 more
Caused by: java.lang.NoClassDefFoundError: org/jdom2/JDOMException
at DashboardController.convert(DashboardController.java:65)
... 58 more
Caused by: java.lang.ClassNotFoundException: org.jdom2.JDOMException
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)
... 59 more
我的清单文件是:
Manifest-Version: 1.0
Main-Class: Dashboard
我阅读了这些文章,但我仍然不知道缺少什么。你明白了吗?