say i create a program in clojure and i have to deliver it to a client. the client does have some computer knowledge but he does not know/want to start the repl, load my program, and run it. he wants to double click an exe file or run a shell script
how do i package my program and deliver (the program itself with the clojure jars) ?
You have a few choices:
lein uberjar
, making sure that you have declared a main class.java -cp ./clojure.jar:./myprogram.jar com.my.runthis.class
java -cp ./clojure.jar:./myprogram.jar clojure.main -e "(in-ns 'your-ns)(start-your-program)" -r
Simplest approach would be to let leiningen handle the jar for you it will package everything into a single fat jar thats all you need to deliver just like any other java app. All client has to do is double click on it. If you need an .exe file launch4j can create it for you, it can also handle JRE installation is it is not already installed on the clients machine. You don't need any bash scripts etc.
You can use leiningen to create uberjar, as Greg Harman wrote... I personally use maven to create standalone jar with all dependencies, declare main class - this simplify run of it with 'java -jar your-jar-file' command. I also use Izpack to create installers for my programs
The best approach I have found for doing this is cake bin
if you are using cake. It will generate a packaged binary for you (probably same as or similar to launch4j).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With