-
-
Save qmx/3765407 to your computer and use it in GitHub Desktop.
One-liner to turn jar with Main-Class into executable shell script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# simple script for turning a jar with a Main-Class | |
# into a stand alone executable | |
# cat [your jar file] >> [this file] | |
# then chmod +x [this file] | |
# you can now exec [this file] | |
commandToRun="$(printf "%q " "$@")" | |
if test "$commandToRun" = "'' "; then | |
eval "java -Xmx1G -jar $0" | |
else | |
eval "java -Xmx1G -jar $0 $commandToRun" | |
fi | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment