Skip to content

Conversation

@jacobmorzinski
Copy link

On Unix, use double quotes around "$0" to protect against
the case where the script may have spaces in its name.

On Windows, the name of the batch file is in variable %0,
available as "%~f0" for a quoted fully-qualified path.
The variable %1 is the first commandline arg, and is not
the right variable for -jar or -Xbootclasspath . This patch
puts "%~f0" into the right places and removes %1 as needed.

Enhancement: for such a short preamble, putting "@echo off"
is minor overkill - it is simpler to just have a "@" at
the start of the "java" and "goto" lines.

On Unix, use double quotes around "$0" to protect against
the case where the script may have spaces in its name.

On Windows, the name of the batch file is in variable %0,
available as "%~f0" for a quoted fully-qualified path.
The variable %1 is the first commandline arg, and is not
the right variable for -jar or -Xbootclasspath . This patch
puts "%~f0" into the right places and removes %1 as needed.

Enhancement: for such a short preamble, putting "@echo off"
is minor overkill - it is simpler to just have a "@" at
the start of the "java" and "goto" lines.
@jacobmorzinski
Copy link
Author

This pull request is supposed to help with issue #24
I've tested it on Windows 10 and Ubuntu Linux, and it works for me on both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants