问题描述
我想知道是否有每个 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 及更早版本中,总共最多可以合并这么多类或其他文件.许多工具还包括作为整体的目录,这减少了可用于类和其他文件的整体.
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屋!
更多推荐
[db:关键词]
发布评论