Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/sh
# 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 "exec java -Xmx1G -jar $0"
else
eval "exec java -Xmx1G -jar $0 $commandToRun"
fi
@briandealwis

This comment has been minimized.

Copy link

commented Jan 17, 2011

Nice discovery! This can be simplified to a single line: https://gist.github.com/782862

@briandealwis

This comment has been minimized.

Copy link

commented Aug 17, 2016

This doesn't seem to work any more 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.