0

I made a program with third party libraries like apache and i'm trying to put them all in a runnable .jar file. I searched a lot, and i found a program named "JarSplice - The Fat Jar Creator" but when i go to create the final jar i'm getting the error:

Jar creation failed due to the following exception:
duplicate entry: org/apache/xmlbeans/xml/stream/Location.class

My 3rd party libs are:

poi-3.14-20160307.jar
poi-examples-3.14-20160307.jar
poi-excelant-3.14-20160307.jar
poi-ooxml-3.14-20160307.jar
poi-ooxml-schemas-3.14-20160307.jar
poi-scratchpad-3.14-20160307.jar
xmlbeans-2.6.0.jar

I dont see any duplicates :/ So what am i doing wrong? Is there any way to void this error? Any help will be highly appreciated!

John
  • 81
  • 2
  • 12
  • I would highly suggest using [Maven](https://maven.apache.org/index.html) to create a JAR with dependencies. If you really do want a single JAR with all the class files in it, you can use the Maven [shade plugin](https://maven.apache.org/plugins/maven-shade-plugin/). – Adam Aug 19 '16 at 19:55
  • Thanks for your answer @adamr. i did it this way [link](https://dzone.com/articles/how-build-fat-jar-using) – John Aug 22 '16 at 05:07
  • Cool, glad you got it to work. I think you should post your solution as an answer and accept it, it might help somebody in the future. – Adam Aug 22 '16 at 18:01
  • done! thank you for your time – John Aug 23 '16 at 04:39

1 Answers1

0

This worked for me at the end. (for netbeans users) How to Build a Fat JAR using NetBeans IDE

John
  • 81
  • 2
  • 12