I made a project named my-stuff and added to the project.clj so it looks like this
(defproject my-stuff "0.1.0-SNAPSHOT"
:description "Testing lein"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"] [clj-http "0.5.5"]]
:main my-stuff.core)
so i can run the core however when I try to run lein run i get this
Learning\my-stuff>lein run
Exception in thread "main" java.lang.Exception: Cannot find anything to run for:
my-stuff.core
at user$eval5.invoke(form-init5159589073116828284.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6619)
at clojure.lang.Compiler.eval(Compiler.java:6609)
at clojure.lang.Compiler.load(Compiler.java:7064)
at clojure.lang.Compiler.loadFile(Compiler.java:7020)
at clojure.main$load_script.invoke(main.clj:294)
at clojure.main$init_opt.invoke(main.clj:299)
at clojure.main$initialize.invoke(main.clj:327)
at clojure.main$null_opt.invoke(main.clj:362)
at clojure.main$main.doInvoke(main.clj:440)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:419)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.main.main(main.java:37)
\Clojure\Learning\my-stuff>
even tho the core does exist in the source.
what do i do?
Most Clojure projects are still built using Leiningen.
In all cases, download the file, make it executable if necessary, and then it's ready to use. The first time the script is run it will download the rest of the Leiningen application, and then this will be cached from this point forward: $ ./lein Downloading Leiningen to /Users/user/. lein/self-installs/leiningen-2.8.
To start a REPL session in Eclipse, click the Menu option, go to Run As → Clojure Application. This will start a new REPL session in a separate window along with the console output.
Setting the :main
key in the project.clj file directs Leiningen to run the -main
function in the specified namespace. It is not included in the default lein template, so you need to add it.
(ns my-stuff.core)
(defn -main [& args]
(println "Working!"))
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