Can i merge many jar files into one jar file

I have several JAR files that I have to add to the classpath in Eclipse.

Is it possible to combine 30 files into one file and include this file?

+3
source share
8 answers

You might want to watch jarjar .

If you use the ant task, you can also go to zipgroupfileset:

<zip destfile="jarlibrary.jar">
    <zipgroupfileset dir="lib" includes="*.jar"/>
</zip>
+6
source

You can, but I don’t think it would be nice to do it. Three possible causes, and undoubtedly more of them:

  • It's hard to see where any one compound file comes from.
  • This makes it difficult to replace just one library.
  • , jar, ""? , jar ... , ... , , .

, jar .

+6
+3

. ,

+2

jarjar - , .

+1

, , , Ant, jarjar eclipse.

+1

-, . JAR - ZIP . , zip ( WinZip ), *.jar( ) .

, , , , , jar ( ). manfest.mf . , , , .

, . JarJar.

: ? maven, lib . eclipse, 2-3 . .

maven, pom.xml, , mvn eclipse:eclipse. .classspath .project. .

+1
source

Jar files are just ZIP files, so you can try to unzip all the jars, put all the files together, and then ZIP files again.

0
source

Source: https://habr.com/ru/post/1794087/


All Articles