Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Leiningen: Create executable jar to run without java -jar

I'm trying to understand how to package a command line application written in Clojure for distribution. I don't want users to have to use java -jar myproject.jar arg1 arg2 to run the program. PHP has something called "Phar" files, which are basically executable zip files, so they include a shebang that tells POSIX systems how to unpack and run them.

I've seen other Clojure apps that allow the jar file to be set chmod +x and then executed directly. How do they achieve this? Uberjar just seems to make a jar that requires the java -jar prefix.

like image 690
d11wtq Avatar asked Jan 29 '26 03:01

d11wtq


1 Answers

You can do this using lein-bin.

like image 162
bsvingen Avatar answered Jan 30 '26 20:01

bsvingen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!