每个jar的最大文件数是多少? [英] What is the maximum number of files per jar?
问题描述
我想知道每个jar是否允许最大数量的文件,之后你可以遇到类路径问题,比如不考虑类?
I'd like to know if there is a maximum number of files allowed per jar, after which you can have classpath issues like classes not taken into account?
推荐答案
jar格式只是一种重新组合的zip格式,因此它继承了该格式的限制。
The jar format is just a rebranded zip format, so it inherits the limitations of that format.
原始zip格式的限制为65535个条目,因此在Java 6及更早版本中,您最多可以组合多个类或其他文件。许多工具还包括目录作为entires,这减少了类和其他文件的可用内容。
The original zip format has a limit of 65535 entries, so in total in Java 6 and earlier, you can have at most that many classes or other files, combined. Many tools also include directories as entires, and this reduces the entires available for classes and other files.
在java 7中, zip64 ,具有更高的限制。
In java 7, zip64 is supported, with a much higher limit.
我怀疑失败模式不会随机丢失文件,但会在jar生成时失败。
I suspect the failure mode, however, won't be randomly missing files, but failure at jar generation time.
这篇关于每个jar的最大文件数是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!