Reputation: 139
I would like to know if there is a way of passing Windows environment variables as arguments in JNLP files?
I have a JNLP file in which I specify an argument that should be passed to the application's main method. If possible, I would like the argument to take the form %USERPROFILE%/dir/file
. However, when I try to execute like this, webstart is taking userprofile as a literal value instead of replacing it with the environment variable.
Upvotes: 2
Views: 1380
Reputation: 11238
The value of system property user.dir
should be equivalent to %USERPROFILE%
as an abstract file path. Instead of specifying file as a JNLP program argument, obtain it as follows:
File file = new File(System.getProperty("user.dir"), "dir/file");
Upvotes: 1