Skip to content

Instantly share code, notes, and snippets.

@qmx
Forked from briandealwis/gist:782862
Created September 22, 2012 07:00
Show Gist options
  • Save qmx/3765407 to your computer and use it in GitHub Desktop.
Save qmx/3765407 to your computer and use it in GitHub Desktop.
One-liner to turn jar with Main-Class into executable shell script
#!/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]
exec java -Xmx1G -jar "$0" "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment