Reputation: 41
How can I programmatically find the path of JNLP file?I am using Java Web Start to generate the JNLP file.
I know that manually you can find the JNLP file in the Java Cache Viewer in Resources with the name launch.jnlp
, but I really need to know if there exists a Java class that can programmatically find the jnlp file by searching the in-memory cache.
Upvotes: 2
Views: 1849
Reputation: 168825
How can I programatically find the path of JNLP file?
It is hidden deliberately. If you can find it from within code (shorting of asking the user to browse to it), the JRE has a security bug.
..for launching the installer I need the application jar files path
No you don't.
getResource(String)
.byte[]
and write it to a temporary file at a known location (e.g. java.io.tmpdir
).Upvotes: 1