Last active
March 17, 2018 21:06
-
-
Save micalevisk/32d6a04b774827d4366a195c507294b9 to your computer and use it in GitHub Desktop.
[Linux] JAR to Executable
This file contains 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 | |
# (c) https://coderwall.com/p/ssuaxa/how-to-make-a-jar-file-linux-executable | |
# $ cat stub.sh helloworld.jar > hello.run && chmod +x helloworld.run | |
MYSELF=`which "$0" 2>/dev/null` | |
[ $? -gt 0 -a -f "$0" ] && MYSELF="./$0" | |
java=java | |
if test -n "$JAVA_HOME"; then | |
java="$JAVA_HOME/bin/java" | |
fi | |
exec "$java" $java_args -jar $MYSELF "$@" | |
exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment