If you do
jar -i <path>/foo.jar
instead of
cd <path>
jar -i foo.jar
the names of the jar files in the generated index are all prefixed by <path>, including the jars that were specified in relative form in Class-Path. This breaks the operation of URLClassLoader: URLClassPath attempts to construct URLs from the names in the index, relative to the real base URL, and the result is nonsense paths that reflect the original build tree rather than the actual runtime deployment, with the end effect that the index is ignored.
jar -i <path>/foo.jar
instead of
cd <path>
jar -i foo.jar
the names of the jar files in the generated index are all prefixed by <path>, including the jars that were specified in relative form in Class-Path. This breaks the operation of URLClassLoader: URLClassPath attempts to construct URLs from the names in the index, relative to the real base URL, and the result is nonsense paths that reflect the original build tree rather than the actual runtime deployment, with the end effect that the index is ignored.
- duplicates
-
JDK-4599545 JAR Index generates absolute paths instead of relative ones
- Closed