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
# turn a jar with a Main-Class into a stand alone executable
(echo '#!/usr/bin/env java -jar'; cat blahblah.jar) > blah
# turn a jar with a particular main clas into a stand alone executable
(echo '#!/usr/bin/env java -jar package.MainClass'; cat blahblah.jar) > blah
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment