How do you build the clojure into linux or mac executable file? I can't seem to find the answer after googling.
I have a program src/project_name/core.clj . I wish to compile and build native executable. Please help
You usually compile it into a jar file and run that on the JVM.
However if you have the clojure cli tools installed which you can do on mac with brew using brew install clojure, you can execute .clj files that have shebang at the top like this
#! /usr/bin/env clj
(prn "Hello, world")
After running chmod a+x ./helloworld.clj, I can execute this by running ./helloworld.clj
This doesn't compile anything though. If you want it compiled the build a jar. If you are running leiningen you can use lein uberjar to build a jar file. Then start it with java -jar <artifact-name>.jar