I have problem with creating executable jar file. I creating the jar file by Intellij idea X artifacts. But when I try to execute this jar, it gave me an error:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/persistence/EntityNotFoundException
Caused by: java.lang.ClassNotFoundException: javax.persistence.EntityNotFoundException
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
I check which package contains this class and I found it in this maven dependency:
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
</dependency>
I check if the Intellij add this jar to my executable jar and I found it there. So have someone any Idea where the problem is?