You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求助:在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.jar instead 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>

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 08:07:31