Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

Create self executing Jars #28

Open
ricallinson opened this issue Mar 30, 2016 · 0 comments
Open

Create self executing Jars #28

ricallinson opened this issue Mar 30, 2016 · 0 comments

Comments

@ricallinson
Copy link
Collaborator

Jar files are really zip archives, which will tolerate a comment line at the head of the file.

$ head -n 1 ~/bin/JarFile

!/home/y/bin/java -jar

chmod +x ~/bin/JarFile

To execute this trick at home, prefix a command as above (your java location may vary) to the jar file by concatenation, then use chmod to set the executable bit in the file mode, and you're good to go.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant