求助:在Windows系统上运行Clojure 1.9.0遇到问题
Fix for "Could not find or load main class clojure.main" on Windows
Hey there! I think I’ve spotted the root cause of your issue—it all boils down to the classpath separator in your java command.
On Windows, Java uses a semicolon (;) to separate entries in the classpath, whereas colon (:) is used for Linux/macOS. That tiny difference is why Java couldn’t locate the clojure.main class, even though you confirmed it exists in the JAR file.
Here’s the corrected command you should use:
java -cp clojure-1.9.0.jar;spec.alpha-0.1.143.jar;core.specs.alpha-0.1.24.jar clojure.main
Extra tips if you still run into issues:
- If your JAR files are stored in a directory with spaces in the path, wrap the entire classpath in double quotes to avoid parsing errors:
java -cp "C:\My Clojure Files\clojure-1.9.0.jar;C:\My Clojure Files\spec.alpha-0.1.143.jar;C:\My Clojure Files\core.specs.alpha-0.1.24.jar" clojure.main - Stick with the full
clojure-1.9.0.jarinstead of the slim version—since you’re explicitly including the spec dependencies separately, the full JAR will have all the core components you need to run Clojure successfully.
This adjustment should get Clojure 1.9.0 running via the command line without needing Leiningen or Boot.
内容的提问来源于stack exchange,提问作者Bob Jarvis - Слава</think_never_used_51bce0c785ca2f68081bfa7d91973934>
相关产品推荐
相关产品推荐

