【问题标题】:How to change Clojure or Lein's Clojure default version?如何更改 Clojure 或 Lein 的 Clojure 默认版本?
【发布时间】:2013-03-02 03:32:58
【问题描述】:

我不知道为什么,但是当我通过 $ clojure 或 $ lein repl 输入 REPL 时,>(clojure-version) 会显示“1.2.1”。我想让它说“1.5”。

1.5 版在我由 lein 管理的项目中运行良好。我只想告诉 lein 默认使用 1.5,而不是 1.2。

【问题讨论】:

    标签: clojure leiningen


    【解决方案1】:

    目前在项目之外不支持此功能,但正在处理中:https://github.com/technomancy/leiningen/issues/966

    目前的解决方法是在你的 project.clj 中指定它

    进一步推荐:升级到 Leiningen 2.0。

    【讨论】:

    • 新建项目时,如何告诉lein使用1.5而不是1.4? (我的意思是默认情况下,所以我不必每次都编辑 project.clj)。在 profile.clj 中添加 1.5 作为依赖项不起作用。
    • 我刚才在 IRC 上询问了技术专家。他说:“REPL 的外部项目被硬编码为 lein 的 clojure 版本”。
    • 顺便说一句,github.com/technomancy/leiningen/issues/966 不是根本问题(再次根据 IRC 讨论)“您可以使用 :dependencies(在 /.lein/profiles.clj 中)将内容添加到非项目 REPL”但是“你不能用profiles.clj来替换已经加载的东西”
    猜你喜欢
    • 2018-07-07
    • 2012-04-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-19
    相关资源
    最近更新 更多