Doing projects with leingingen
Leiningen is a simple building tool for clojure. It will make "Build" files for your clojure project.
You can install leniingin by this script. Alsoit will install clojure for you.
First download the lein file from this. Then,
chmod +x lein
It will install all the nessesary things.
Now we can create the project. I will create a simple project to display "Hello World". So for do that;
Then you should edit the helloworld.clj file like this.
(defn -main [& args]
(println "Hello world"))
Then you must create a file call project.clj in the helloworld directory. That file should contain,
(defproject helloworld "0.1"
Now you had complete the source files and project details files. It is time to compile the project.
To compile the project you must type,
$ lein compile
This will compile the project and create lib file which contains all jar files of the project. But we can create a single .jar file for the project. To make it,
$ lein uberjar
This will create two jar files, you can distribute your project with the standalone.jar file.
to run the jar file you must type,