scala - Why java complains about jar files with lots of entries? -


i stumbled upon following problem - when create .jar file more 65k entries, java complains "invalid or corrupt jarfile". example:

$ # in fresh dir $ in {1..70000}; touch $i; done $ jar cf app.jar {1..70000} $ java -jar app.jar error: invalid or corrupt jarfile app.jar 

but if use bit less files, works:

$ jar cf app.jar {1..60000} $ java -jar app.jar no main manifest attribute, in app.jar 

i heard there 65k files limit in old .zip file format, java 7 should use zip64 default already. why happening? there way fix it?

why happening?

it's bug in java 1.7.0 (aka java 7)

fixed in java 1.7.0 p40 or later, apparently.

is there way fix it?

according bug report, workaround (for java 1.7.0) launch application without using -jar option.


fwiw, there bug in javacs handling of zip64 format jar files:


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -