FULL PRODUCT VERSION : LANELSON-mac:~ LANELSON$ java -version java version "1.8.0_74" Java(TM) SE Runtime Environment (build 1.8.0_74-b02) Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode) LANELSON-mac:~ LANELSON$ ADDITIONAL OS VERSION INFORMATION : LANELSON-mac:test LANELSON$ uname -a Darwin LANELSON-mac 15.6.0 Darwin Kernel Version 15.6.0: Mon Aug 29 20:21:34 PDT 2016; root:xnu-3248.60.11~1/RELEASE_X86_64 x86_64 A DESCRIPTION OF THE PROBLEM : If you supply a URLClassLoader with only one URL like this: jar:file:/some/file.jar!/ ...and file.jar is located in a directory with extra.jar, and file.jar's META-INF/MANIFEST.MF resource has a Class-Path header like so: Class-Path: extra.jar ...the URLClassLoader will be unable to load classes found in extra.jar--that is, it does not respect file.jar's META-INF/MANIFEST.MF's Class-Path header. However, if you supply the URLClassLoader with an equivalent URL like this: file:/some/file.jar ...while leaving everything else unchanged, the Class-Path header is processed correctly and the URLClassLoader can load classes found in extra.jar. See http://stackoverflow.com/questions/39906038/does-urlclassloader-traverse-manifest-mf-class-path-headers-properly for a unit test. REPRODUCIBILITY : This bug can be reproduced always.
|