Does URLClassLoader.addURL(URL) honor the META-INF/MANIFEST.MF

一曲冷凌霜 提交于 2019-12-10 10:46:04

问题


If I have a jar that includes a Class-Path entry in the MANIFEST.MF. If I add the jar to a URLClassLoader, are the jars in the Class-Path entry also added to the classloader? Do I need to introspect the jars that I want to add to the classloader to detect this and call addURL for each of them (recursively)?


回答1:


It does as of JDK 1.6 according to the source code of sun.misc.URLClassPath, but it isn't specified, so take your pick ;-)



来源:https://stackoverflow.com/questions/10908573/does-urlclassloader-addurlurl-honor-the-meta-inf-manifest-mf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!