jpackage ROOTDIR variable in a Windows bat file

Michael Hall mik3hall at gmail.com
Sat Nov 23 17:10:18 UTC 2019



> On Nov 23, 2019, at 10:51 AM, Kevin Rushforth <kevin.rushforth at oracle.com> wrote:
> 
> $ROOTDIR is not a supported interface. You should use "$APPDIR" instead. Having said that, the real problem is likely your use of backslashes. I recommend using forward slashes and also enclosing it in single quotes, like this:

It is apparently sometimes a unsupported interface. Since my OS X invocation works with…
-Djava.security.policy=$ROOTDIR/app/all.policy
I’ll have to change that to APPDIR to be sure it still works. 

But this does show you should be correct for APPDIR being supported…
JDK-8231910     Expose the APPDIR variable to applications that use jpackage

> 
>     -Djava.security.policy='$APPDIR/all.policy'
> 
> If you need to use backslashes for some reason, then you will need to use two (the first is treated as an escape character).
> 

I thought java on Windows was pretty indifferent to forward or backslashes in file paths but I haven’t done much on Windows.
I figured when in Rome or on Windows do what they do.
First try keeping backslashes…

Error: Invalid Option: [-Djava.security.policy=$APPDIR\app\all.policy]

With forward slashes

Error: Invalid Option: [-Djava.security.policy=$ROOTDIR/app/all.policy]


More information about the core-libs-dev mailing list