Karen Fisher
Karen Fisher

Reputation: 777

How to start Clojure REPL from anywhere?

I can start Clojure REPL from directory when it was unpacked (C:\Program Files\clojure-1.6.0) by this command in command line:

java -cp clojure-1.6.0.jar clojure.main

but anytime I want to start REPL I have to enter directory C:\Program Files\clojure-1.6.0, so I create bat file with next content:

java -cp C:\Program Files\clojure-1.6.0\clojure-1.6.0.jar clojure.main

and put it to directory wich includes in PATH variable. I expect that it will run Clojure REPL, but instead of it I get an error

Error: Could not find or load main class Files\clojure-1.6.0\clojure-1.6.0.jar

And I don't find in internet how to fix it. Please help.

Upvotes: 1

Views: 562

Answers (2)

uvtc
uvtc

Reputation: 720

I think you very likely want to install Leiningen.

You can then start a Clojure repl from anywhere with the command lein repl.

Note: lein takes care of getting and managing the Clojure jar for you --- you don't need to "install" Clojure. Just use lein and it takes care of everything. :)

Upvotes: 2

Shlomi
Shlomi

Reputation: 4748

this must be a space issue in "Program Files". try to have the entire path quoted like this:

java -cp "C:\Program Files\clojure-1.6.0\clojure-1.6.0.jar" clojure.main

Upvotes: 2

Related Questions