NetBeans modules run in a separate class loader which makes most of the resource access transparent. This means that the standard getClass().getResource("/com/example/res/some.xml") works. Please note the slash ("/") at the beginning of the string.

Due to Classloader restrictions, you won't be able to access resources in non-public packages from some other modules. That is, you need to have a dependency on the second module, and the resource must be in a public package in order to be able to access it.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo