【问题标题】:No implementation of method: :as-file of protocol: #'clojure.java.io/Coercions found for class: java.lang.Character in leiningen project file没有方法实现:协议文件:#'clojure.java.io/Coercions 找到类:leiningen 项目文件中的 java.lang.Character
【发布时间】:2021-10-06 09:12:36
【问题描述】:

我正在尝试使用 leiningen 创建一个多目标项目,所以我让它生成多个不同的 jar 文件,这是我创建的项目文件:

(defproject linuxmisc "0.1.0-SNAPSHOT"
    :main void.install

    :dependencies [
        [org.clojure/clojure "1.10.1"]]
    
    :resource-path "resources/"
    :target-path "output/%s"
    
    :jvm-opts ["-Dclojure.compiler.direct-linking=true"]
    
    :profiles {
        :void {
            :aot :all
            :main void.install
            :source-path "src/"}
        :nixos {
            :aot :all
            :main nixos.preinstall
            :source-path "src/"}
        :artix {
            :aot :all
            :main artix.preinstall
            :source-path "src/"}}
)

它不断返回错误,我无法弄清楚它有什么问题

【问题讨论】:

    标签: java clojure jvm lisp leiningen


    【解决方案1】:

    我没有看到那个错误。我的文件版本:

     > tree
    .
    ├── project.clj
    ├── src
    │   └── demo
    │       └── core.clj
    └── test
        └── demo
            └── core_test.clj
    
    > cat project.clj 
    (defproject linuxmisc "0.1.0-SNAPSHOT"
      :main demo.core
      :dependencies [[org.clojure/clojure "1.10.1"]]
    
      :resource-path "resources/"
      :target-path "output/%s"
    
      :jvm-opts ["-Dclojure.compiler.direct-linking=true"]
    
      :profiles {
                 :void {
                        :aot :all
                        :main void.install
                        :source-path "src/"}
                 :nixos {
                         :aot :all
                         :main nixos.preinstall
                         :source-path "src/"}
                 :artix {
                         :aot :all
                         :main artix.preinstall
                         :source-path "src/"}}
    

    和代码

    (ns demo.core
      )
    
    (defn -main
      "I don't do a whole lot ... yet."
      [& args]
      (println "-main - enter")
      )
    
    (ns demo.core-test
      (:use clojure.test))
    
    (deftest ttt
      (println "testing...")
      (is true))
    

    结果:

    > lein clean; lein run
    -main - enter
    
    
    > lein clean; lein test
    
    lein test demo.core-test
    testing...
    
    Ran 1 tests containing 1 assertions.
    0 failures, 0 errors.
    
    ``
    
    I'm guessing something weird is happening with your `void.install`, `nixos.preinstall`, or `artix.preinstall` items.  Those don't look like namespaces....?
    

    【讨论】:

    • 啊,看来我所要做的就是运行 lein clean...
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-03
    • 1970-01-01
    • 2012-08-17
    相关资源
    最近更新 更多