1
votes

Last month I asked this question about how to get the latest version of Clojure to run on Windows. @cfrick was kind enough to provide some guidance, but after following his suggestion and monkeying with it for a while now I'm still unable to get Clojure 1.9.0 to run on Windows. I know I must be doing something stupid, but here's what I've got:

I downloaded all the 1.9.0 jars from clojure.org and put them in a directory, along with the core.specs.alpha and spec.alpha jars:

01/12/2018  10:34 PM    <DIR>          .
01/12/2018  10:34 PM    <DIR>          ..
12/14/2017  05:55 PM         3,688,794 clojure-1.9.0.jar
12/14/2017  05:55 PM         2,816,528 clojure-1.9.0-javadoc.jar
12/14/2017  05:55 PM         1,052,237 clojure-1.9.0-slim.jar
12/14/2017  05:55 PM           606,466 clojure-1.9.0-sources.jar
01/12/2018  03:43 PM             4,236 core.specs.alpha-0.1.24.jar
01/12/2018  03:42 PM           591,287 spec.alpha-0.1.143.jar

I then tried the command line @cfrick suggested, substituting in the up-to-date version numbers of the specs.alpha and core.specs.alpha jars:

java -cp clojure-1.9.0.jar:spec.alpha-0.1.143.jar:core.specs.alpha-0.1.24.jar clojure.main

Unfortunately, this produces the following error message:

Error: Could not find or load main class clojure.main

That's all that it dumps, so at least that's an improvement over the long list of errors it threw when it couldn't find core.specs.alpha and spec.alpha. :-)

So I dug out the jar utility, dumped the contents of clojure-1.9.0.jar into a file, and found that the class clojure/main.class exists in the jar. I tried re-running the java command above specifying the class name as clojure/main instead of clojure.main but got exactly the same error, so I guess there's no difference between . and / in the class name.

Just for fun (?) I tried running it using clojure-1.9.0-slim.jar but got the same error. I also tried surrounding the specified class path in double quotes, just to try something else, but got the same results. I also tried fully-qualifying the names of the .jar files with the directory in which they reside, appropriately double-quoted - still, same error.

I'd appreciate further guidance on how to get Clojure 1.9.0 to run from the command line, without using something like Leiningen or Boot.

2

2 Answers

2
votes

Instead of : use ; as the class path separator:

java -cp clojure-1.9.0.jar;spec.alpha-0.1.143.jar;core.specs.alpha-0.1.24.jar clojure.main

1
votes

The answer is to install Boot or Lein, really you're not going to get far without those.