当前位置: 首页 > 知识库问答 >
问题:

没有实现方法::作为协议的文件:#'clojure。JAVA为类java找到io/强制。leiningen项目文件中的lang.字符

苏墨竹
2023-03-14

我正在尝试使用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/"}}
)

它不断返回错误,我不知道它到底出了什么问题

共有1个答案

计均
2023-03-14

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

 > 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....?
 类似资料: