Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Yes, it is possible for ClassLoader.getResources() function to work successfully within the module-path but not within jlink.

In the module-path, the ClassLoader.getResources() function can access all the resources present within the module-path and the modules it depends on. However, when using jlink to create a custom runtime image, only the modules that are explicitly included in the image will be available, and all other modules and resources outside of the image will be inaccessible. As a result, the ClassLoader.getResources() function may not be able to find the resources it needs if they are not included in the jlink image.