How can I run a .clj Clojure file I created?

前端 未结 8 1784
夕颜
夕颜 2021-01-30 08:19

I\'ve installed Geany on my Linux Mint machine and I wrote some simple code. Just a small hello world to get started with the language.

Now I\'d like to run it and see w

8条回答
  •  猫巷女王i
    2021-01-30 08:48

    You can run script with following command:

    java -cp clojure.jar clojure.main file.clj
    

    but it's better to use leiningen, especially when you'll start to add dependencies to your project. lein provides number of commands to run your code (with all necessary dependencies), pack code into archive with lein jar, or create complete, independent archives with lein uberjar that you can run with:

    java -jar your_app.jar
    

    command

    P.S. You can read how to use lein in following article - it describes base tasks & configurations

提交回复
热议问题