Ask Your Question
1

Can ClassLoader.getResources() function successfully within module-path but not within jlink?

asked 2021-10-19 11:00:00 +0000

plato gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2021-09-16 00:00:00 +0000

scrum gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-10-19 11:00:00 +0000

Seen: 10 times

Last updated: Sep 16 '21