Can i combine many jar files in one jar file

前端 未结 8 2084
囚心锁ツ
囚心锁ツ 2020-12-18 11:07

I have multiple JAR files, which I have to add to classpath in Eclipse.

Is it possible to combine 30 files in one file and include that file?

8条回答
  •  情书的邮戳
    2020-12-18 11:13

    You can, but I don't think it would necessarily be a good idea to do so. Three possible reasons, and no doubt there are more:

    • It makes it harder to see where any one constituent file comes from.
    • It makes it harder to replace just one library
    • If there are files which are contained in multiple jar files, which should "win"? For example, all the jar files will have their own manifest... you may be able to merge them all, but not necessarily... and for other files there may well simply not be a sensible way of merging them.

    My vote is to keep the jar files separate.

提交回复
热议问题