Jonas Byström
Jonas Byström

Reputation: 26129

Classpath in a Java Web Start application

I need to load an .xml file in META-INF, it works when the application isn't sandboxed, but in Java Web Start a different classloader (which is more restricted) seems to be used, so the file found in myproj.jar/META-INF/myfile.xml isn't loaded. It however works if I put the file in the current directory of the loading class (I put it under com/blabla/myproj/whatever/META-INF/myfile.xml).

I couldn't find any classpath settings within the .jnlp file, but perhaps this can be done with a manifest? I don't know how they work, so if that's the solution please supply an example.

Upvotes: 1

Views: 1753

Answers (1)

Mark Peters
Mark Peters

Reputation: 81054

Stuff in META-INF should not be readable by code in your jar file, since that code should be agnostic to the fact that it's packaged in a JAR. Instead, since it is meta information (meta-inf) about the Jar itself, only the application that loads the jar file should access it.

Upvotes: 2

Related Questions