Question

I have an applet ,whose init() method calls an jnlp file which downloads a jar.(using Runtime class and exec('javaws +path of jnlp). But am not able to give a realtive path of jnlp file. Is there any workaround from which i can supply realtive path?Works when i give an absolute path of jnlp file.

Was it helpful?

Solution 2

An applet runs inside a web browser and your jnlp file is still on the web server. So you can't access it via file system - even if you have the permission, because it is simply not there. Two possibilities:

1.) Access your jnlp file via http://yourwebserver.domain/webproject/webcontent/lib/myfile.jnlp

2.) Add your jnlp file to your applet.jar and load it with: getClass().getClassLoader().getResourceAsStream("myfile.jnlp");

OTHER TIPS

..jnlp file in lib of my web project

It will not be accessible there, and should be moved to an area on the server that is available to a browser (and the JWS Client that is trying to access it).

Be sure to check the JNLP using JaNeLA, available here. When loading the JNLP, use the address the end user would use to get it (and not an address on the file system).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top