Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Impacts of including too many jar files in classpath

Tags:

java

jar

I have a big jar file that has a lot of dependencies on other jar files ~40 files totaling a few hundred MB. I'm worried about dependencies issues with this jar file so I would like the to add the required dependencies to the Manifest file of this jar at compile time. I'm wondering if there are negative drawbacks to this approach. I've done some testing on class load times and they don't really seem to be affected all that much.

Another reason I want to move the dependencies into the jar's manifest is that with so many files the command line gets long and hard to read. We have a lot of -XX options etc. as well being passed into the JVM but it looks like there isn't a way to set these in the manifest or in some sort of configuration file though.

like image 833
john Avatar asked Apr 06 '12 12:04

john


1 Answers

If you depend on these jars, then it's OK. 40 dependencies is not that much, actually, so don't consider that a problem. Just make sure you don't include unused dependencies.

like image 76
Bozho Avatar answered Nov 01 '22 03:11

Bozho