• Post Reply Bookmark Topic Watch Topic
  • New Topic

No Class Def Found Error  RSS feed

 
Shankara Sharma
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I was trying to execute a JAR that has all the dependecies copied under JAR lib folder. But when I try executing the JAR command line I was getting below error

       

Here is my JAR structure:

abc.jar
---lib\all dependency libraries
---com\abc
---META-INF

here is my pom.xml


Please let me know how can I add the jars under lib folder to jar classpath.
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The default class loader cannot access classes in JAR files that are located inside another JAR file. I suggest you take a look at the shade Maven plugin. That will put not only your classes in the JAR file, but also the contents of all your dependencies. I prefer it over OneJar because with a shaded JAR file, you can still access any class inside.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!