2024 Clojure调查中分享您的想法!

欢迎!请查看关于页面以了解更多关于该网站如何工作的信息。

0投票
编译器

嘿,

我想使用这个Git仓库。安装对我来说成功了,但是当我运行mvn -X exec:java时,我遇到了以下错误

    java.lang.ExceptionInInitializerError
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:293)
    at java.lang.Thread.run (Thread.java:748)
[...]

    Caused by: java.io.FileNotFoundException: Could not locate clojure/spec__init.class, clojure/spec.clj or clojure/spec.cljc on classpath.
    at clojure.lang.RT.load (RT.java:466)
    at clojure.lang.RT.load (RT.java:428)
    at clojure.core$load$fn__6824.invoke (core.clj:6126)
    at clojure.core$load.invokeStatic (core.clj:6125)
    at clojure.core$load.doInvoke (core.clj:6109)
    at clojure.lang.RestFn.invoke (RestFn.java:408)
    at clojure.core$load_one.invokeStatic (core.clj:5908)
    at clojure.core$load_one.invoke (core.clj:5903)
    at clojure.core$load_lib$fn__6765.invoke (core.clj:5948)
    at clojure.core$load_lib.invokeStatic (core.clj:5947)
    at clojure.core$load_lib.doInvoke (core.clj:5928)
    at clojure.lang.RestFn.applyTo (RestFn.java:142)
    at clojure.core$apply.invokeStatic (core.clj:667)
    at clojure.core$load_libs.invokeStatic (core.clj:5985)
    at clojure.core$load_libs.doInvoke (core.clj:5969)
    at clojure.lang.RestFn.applyTo (RestFn.java:137)
    at clojure.core$apply.invokeStatic (core.clj:667)
    at clojure.core$require.invokeStatic (core.clj:6007)
    at clojure.core$require.doInvoke (core.clj:6007)
    at clojure.lang.RestFn.invoke (RestFn.java:408)
    at edu.upc.nlp4bpm_commons.config$eval211$loading__6706__auto____212.invoke (config.clj:1)
    at edu.upc.nlp4bpm_commons.config$eval211.invokeStatic (config.clj:1)
    at edu.upc.nlp4bpm_commons.config$eval211.invoke (config.clj:1)
    at clojure.lang.Compiler.eval (Compiler.java:7176)
    at clojure.lang.Compiler.eval (Compiler.java:7165)
    at clojure.lang.Compiler.load (Compiler.java:7635)
    at clojure.lang.RT.loadResourceScript (RT.java:381)
    at clojure.lang.RT.loadResourceScript (RT.java:372)
    at clojure.lang.RT.load (RT.java:463)
    at clojure.lang.RT.load (RT.java:428)
    at clojure.core$load$fn__6824.invoke (core.clj:6126)
    at clojure.core$load.invokeStatic (core.clj:6125)
    at clojure.core$load.doInvoke (core.clj:6109)
    at clojure.lang.RestFn.invoke (RestFn.java:408)
    at clojure.core$load_one.invokeStatic (core.clj:5908)
    at clojure.core$load_one.invoke (core.clj:5903)
    at clojure.core$load_lib$fn__6765.invoke (core.clj:5948)
    at clojure.core$load_lib.invokeStatic (core.clj:5947)
    at clojure.core$load_lib.doInvoke (core.clj:5928)
    at clojure.lang.RestFn.applyTo (RestFn.java:142)
    at clojure.core$apply.invokeStatic (core.clj:667)
    at clojure.core$load_libs.invokeStatic (core.clj:5985)
    at clojure.core$load_libs.doInvoke (core.clj:5969)
    at clojure.lang.RestFn.applyTo (RestFn.java:137)
    at clojure.core$apply.invokeStatic (core.clj:667)
    at clojure.core$require.invokeStatic (core.clj:6007)
    at clojure.core$require.doInvoke (core.clj:6007)
    at clojure.lang.RestFn.invoke (RestFn.java:482)
    at du.upc.nlp4bpm_commons.freeling_api$eval150$loading__6706__auto____151.invoke (freeling_api.clj:1)
    at edu.upc.nlp4bpm_commons.freeling_api$eval150.invokeStatic (freeling_api.clj:1)
    at edu.upc.nlp4bpm_commons.freeling_api$eval150.invoke (freeling_api.clj:1)
    at clojure.lang.Compiler.eval (Compiler.java:7176)
    at clojure.lang.Compiler.eval (Compiler.java:7165)
    at clojure.lang.Compiler.load (Compiler.java:7635)
    at clojure.lang.RT.loadResourceScript (RT.java:381)
    at clojure.lang.RT.loadResourceScript (RT.java:372)
    at clojure.lang.RT.load (RT.java:463)
    at clojure.lang.RT.load (RT.java:428)
    at clojure.core$load$fn__6824.invoke (core.clj:6126)
    at clojure.core$load.invokeStatic (core.clj:6125)
    at clojure.core$load.doInvoke (core.clj:6109)
    at clojure.lang.RestFn.invoke (RestFn.java:408)
    at clojure.core$load_one.invokeStatic (core.clj:5908)
    at clojure.core$load_one.invoke (core.clj:5903)
    at clojure.core$load_lib$fn__6765.invoke (core.clj:5948)
    at clojure.core$load_lib.invokeStatic (core.clj:5947)
    at clojure.core$load_lib.doInvoke (core.clj:5928)
    at clojure.lang.RestFn.applyTo (RestFn.java:142)
    at clojure.core$apply.invokeStatic (core.clj:667)
    at clojure.core$load_libs.invokeStatic (core.clj:5985)
    at clojure.core$load_libs.doInvoke (core.clj:5969)
    at clojure.lang.RestFn.applyTo (RestFn.java:137)
    at clojure.core$apply.invokeStatic (core.clj:667)
    at clojure.core$require.invokeStatic (core.clj:6007)
    at clojure.core$require.doInvoke (core.clj:6007)
    at clojure.lang.RestFn.invoke (RestFn.java:408)
    at clojure.lang.Var.invoke (Var.java:384)
    at edu.upc.modelvsdocument.StandaloneMain.require (StandaloneMain.java:23)
    at edu.upc.modelvsdocument.StandaloneMain.<clinit> (StandaloneMain.java:12)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:293)
    at java.lang.Thread.run (Thread.java:748)
   

config.clj文件看起来像这样

    (ns edu.upc.modelvsdocument.config
  (:use [edu.upc.modelvsdocument.utils]
        [com.rpl.specter]
        [edu.upc.modelvsdocument.schemas]
        [edu.upc.modelvsdocument.utils]
        [clojure.pprint])
  (:require [clojure.java.io :as io]
            [clojure.spec :as spec]
            [clojure.spec.test :as stest]
            [edu.upc.modelvsdocument.schemas :as t :refer :all]
            [clojure.walk :as walk]))

我读过很多关于clojure/spec/alpha__init.class的内容,但我不确定这与我遇到的问题是否有关。请向这位渴望知识的Clojure新手提供一些智慧:)

mvn & clojure版本

Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 1.8.0_292, vendor: Private Build, runtime: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.10.16.3-microsoft-standard-wsl2", arch: "amd64", family: "unix"

Clojure CLI version 1.10.3.1040

2个回答

0投票

我们很乐意在#clojurians Slack中帮助您,但我认为这会涉及到大量关于您设置和基本Clojure信息的来回讨论,而且不是在这个提问网站上富有成效的用途。

http://clojurians.net/

好的,感谢您的建议!:)
0投票

我的假设是您正在使用 Clojure 1.9+,但是没有包含依赖的 spec.alpha 和 core.specs.alpha 库。

正如 Justin 在另一个答案中提到的,在 Clojurians slack 中获得交互式帮助可能更容易。

...