新的linux(centos7),新的lighttable,新的lein,新项目:
clojure.lang.Compiler $ CompilerException:java.lang.RuntimeException:无法在此上下文中解析符号:defproject,编译:(/ home / zzz / nnn / lighttable / project.clj:1:1)
这是项目:
(defproject lighttable "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]])
经过几年的尝试clojure,有一个项目在prod。 (当然不是这个):我错过了什么吗?
答案 0 :(得分:3)
你可以从一个干净的目录再试一次吗?它似乎对我有用:
~/tmp9 > lein new app lighttable
Generating a project called lighttable based on the 'app' template.
~/tmp9 > cd lighttable
~/tmp9/lighttable > lein run
Hello, World!
~/tmp9/lighttable > cat project.clj
(defproject lighttable "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]]
:main ^:skip-aot lighttable.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all}})
我注意到你有两个:url
条目并且缺少其他一些东西。您是否使用命令lein new app lighttable
创建了它?
答案 1 :(得分:1)
突然间,它没有任何明显的原因。
答案 2 :(得分:1)
如果您像我一样使用 IntelliJ + Cursive,那么如果您的运行/调试配置指向 project.clj
文件而不是 core.clj
的 Clojure 应用程序配置与 {{1 }} 设置为 How to run it