[英]Problems compiling in clojure with Counterclockwise
Hi am totally new to clojure, and have just installed clojure and CounterClockwise. 嗨,您对Clojure完全陌生,并且刚刚安装了Clojure和CounterClockwise。 I have created a new clojure project named "myproject". 我创建了一个名为“ myproject”的新clojure项目。 Entering (foo "test")
gives : "test Hello, World!" 输入(foo "test")
给出:“ test Hello,World!” just as expected. 符合预期。 When I select the "myproject" in the navigator, and run as Java compilation -> Compile clojure.lang, I get following error: 当我在导航器中选择“ myproject”并以Java编译->编译clojure.lang运行时,出现以下错误:
ERROR: Must set system property clojure.compile.path to the location for compiled .class files. 错误:必须将系统属性clojure.compile.path设置为已编译.class文件的位置。 This directory must also be on your CLASSPATH. 此目录也必须在您的CLASSPATH上。
What does this mean? 这是什么意思? How do I fix this? 我该如何解决?
It's generally recommended that you create your projects with the Clojure build tool leiningen (aka "lein"), and use that to create the projects and manage the dependencies etc. counterclockwise detects lein projects automatically . 通常建议您使用Clojure构建工具leiningen (又名“ lein”)创建项目,并使用它创建项目并管理依赖项等。逆时针自动检测lein项目 。 Lein will create a file called project.clj that defines things like compile and source paths as well as the the main class. Lein将创建一个名为project.clj的文件,该文件定义诸如编译路径和源路径以及主类之类的内容。
It seems like the eclipse builtin jar creation tool has some problems. 看来eclipse内置jar创建工具存在一些问题。 CCW recommends to install a plugin for eclipse to create a fat jar: http://fjep.sourceforge.net/ CCW建议为Eclipse安装一个插件来创建一个胖子罐: http : //fjep.sourceforge.net/
CCW documentation: http://doc.ccw-ide.org/documentation.html#_create_a_fat_executable_jar_with_all_dependencies_packaged_into CCW文档: http : //doc.ccw-ide.org/documentation.html#_create_a_fat_executable_jar_with_all_dependencies_packaged_into
I still want to emphasize on using leiningen. 我仍然想强调使用Leiningen。 Whatever you will do later, it is easy to integrate leiningen into your build process, it is independent of the IDE you use and also OS independent. 以后无论做什么,都可以轻松地将leiningen集成到您的构建过程中,它独立于您使用的IDE,也独立于操作系统。
There are a lot more advantages you get with leiningen (existing plugins, templates, community support, ...). 使用leiningen还有很多其他优点(现有的插件,模板,社区支持等)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.