26 April 2014

Convert Jar files to executables on Linux

After finished the image-downloader, I find it very funny to use it to crawl the site to download different backgrounds!

But I find it uncomfortable if I use it as Java jar, so I needed to either wrap it in some shell script (very easy), or convert it into some shell executable, so to forget about the JAR file at all.

I found this command to convert any JAR to shell executable (instead of just wrapping it):

(echo '#!/usr/bin/java -jar'; cat blahblah.jar) > blah
(echo '#!/usr/bin/java -jar'; cat ImageDDL.jar) > imageddl; chmod +x imageddl

It is very awesome!

BTW, You can download the Linux executable from here imageddl!
Post a Comment