When using Class.getResource()
and providing a fairly common resource name, for example, "license.html"
, Java can load the resource "license.html"
from another JAR file that was previously specified in CLASSPATH, but may be completely unrelated to my application . Is there a way to get ClassLoader to first try to load a resource from the same JAR file that my class is in, and only if it is not found, look in other JARs for CLASSPATH?
source share