0

In my project Im using the IDE IntelliJ and I added the library JDOM2. When I run the programm by IDE it works fine but when I build the artificat I get the error:

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

My manifest file is this:

Manifest-Version: 1.0
Main-Class: Dashboard

I read the articles but I have still no idea what is missing. Do you figure it out?

Ero Stefano
  • 556
  • 2
  • 9
  • 27
  • Make sure the dependency is included into the artifact, see http://stackoverflow.com/a/42200519/104891. – CrazyCoder Apr 17 '17 at 19:56
  • @CrazyCoder thats it! Thx! – Ero Stefano Apr 17 '17 at 21:05
  • The answer is here: [http://stackoverflow.com/questions/42196697/adding-external-library-to-build-in-intellij-idea/42200519#42200519](http://stackoverflow.com/questions/42196697/adding-external-library-to-build-in-intellij-idea/42200519#42200519) – Ero Stefano Apr 17 '17 at 21:06

0 Answers0