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 信息的来回讨论,这对这个 ask 站点来说可能不是一个高效的使用。

http://clojurians.net/

好的,谢谢你的建议!:
0票数
by

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

正如Justin在其他答案中说的,在Clojurians slack中获得交互式帮助可能更容易。

...