I recently--as in, today--became interested in learning to program with clojure. Now after having installed the latest version of java's jdk and downloading the leiningen script, I followed the installation instructions for the latter, specifically those given at: http:/www.lispcast.com/clojure-ubuntu.
我最近 - 就像今天一样 - 开始对学习用clojure编程感兴趣。现在安装了最新版本的java jdk并下载了leiningen脚本之后,我按照后者的安装说明进行了操作,特别是那些给出的:http:/www.lispcast.com/clojure-ubuntu。
Now, after the running lein version
and downloading the relevant jar file, the program exits with an error about a class not being found. The error in question reads as follows:
现在,在运行lein版本并下载相关的jar文件之后,程序退出并显示有关未找到类的错误。有问题的错误如下:
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:375)>
at clojure.lang.RT.classForName(RT.java:2168)
at clojure.lang.RT.classForName(RT.java:2177)
at clojure.lang.RT.loadClassForName(RT.java:2196)
at clojure.lang.RT.load(RT.java:443)
at clojure.lang.RT.load(RT.java:419)
at clojure.core$load$fn__5677.invoke(core.clj:5893)
at clojure.core$load.invokeStatic(core.clj:5892)
at clojure.core$load.doInvoke(core.clj:5876)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core__init.load(Unknown Source)
at clojure.core__init.(Unknown Source)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:375)
at clojure.lang.RT.classForName(RT.java:2168)
at clojure.lang.RT.classForName(RT.java:2177)
at clojure.lang.RT.loadClassForName(RT.java:2196)
at clojure.lang.RT.load(RT.java:443)
at clojure.lang.RT.load(RT.java:419)
at clojure.lang.RT.doInit(RT.java:461)
at clojure.lang.RT.(RT.java:331)
at clojure.main.(main.java:20)
Caused by: java.lang.ClassNotFoundException: java/sql/Timestamp
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:375)
at clojure.lang.RT.classForName(RT.java:2168)
at clojure.lang.RT.classForNameNonLoading(RT.java:2181)
at clojure.instant$loading__5569__auto____6869.invoke(instant.clj:9)
at clojure.instant__init.load(Unknown Source)
at clojure.instant__init.(Unknown Source)
... 23 morejava.base / java.lang.Class.forName0(本地方法)中的线程“main”java.lang.ExceptionInInitializerError中的异常,位于java.base / java.lang.Class.forName(Class.java:375)> at clojure。 lang.RT.classForName(RT.java:2168)位于clojure.lang.RT.classForName(RT.java:2177)的clojure.lang.RT.loadClassForName(RT.java:2196)clojure.lang.RT.load (RT.java:443)在clojure.core $ load $ fn__5677.invoke(core.clj:5893)的clojure.lang.RT.load(RT.java:419)clojure.core $ load.invokeStatic(core。 clj:5892)位于clojure.core__上的clojure.core__init.load(未知来源)的clojure.core $ load.doInvoke(core.clj:5876)中的clojure.lang.RestFn.invoke(RestFn.java:408)。(来自java.base / java.lang.Class.forName0(本机方法)的java.base / java.lang.Class.forName(Class.java:375)的clojure.lang.RT.classForName(RT.java) :2178)位于clojure.lang.RT.classForName(RT.java:2177)的clojure.lang.RT.loadClassForName(RT.java:2196)位于clojure.lang.RT.load(RT.java:443)的clojure clojure.lang上的.lang.RT.load(RT.java:419) .RT.doInit(RT.java:461)位于clojure.R的。(RT.java:331)。(main.java:20)引起:java.lang.ClassNotFoundException:java / sql /位于java.base / java.lang.Class.forName(Class.java:375)的java.base / java.lang.Class.forName0(本机方法)的时间戳,位于clojure.lang.RT.classForName(RT.java:2168) )clojure.lang.RT.classForNameNonLoading(RT.java:2181)at clojure.instant $ loading__5569__auto ____ 6869.invoke(instant.clj:9)at clojure.instant__init.load(Unknown Source)at clojure.instant__init。(Unknown Source) ......还有23个
My java 9 jdk is installed in /usr/lib/jvm/java-9-oracle/bin/java
, with my JAVA_HOME
variable set to /usr/lib/jvm/java-9-oracle
but I tried /usr/lib/jvm/java-9-oracle/bin
as well, just in case. I am running xubuntu 16.04.3, if this is of any importance. I did try setting the default java jdk back to the openjdk which is bundled with xubuntu but this also was to no avail.
我的java 9 jdk安装在/ usr / lib / jvm / java-9-oracle / bin / java中,我的JAVA_HOME变量设置为/ usr / lib / jvm / java-9-oracle但我试过/ usr / lib / jvm / java-9-oracle / bin,以防万一。我正在运行xubuntu 16.04.3,如果这是重要的。我确实尝试将默认的java jdk设置回与xubuntu捆绑在一起的openjdk,但这也无济于事。
As an aside, the entire problem originated because I tried running the REPL in intellij after installing the cursive plugin, which didn't work. I then surmised that it might be because I had not installed leiningen beforehand (I thought that the IDE and cursive would have this bundled along). However, the actual information on what intellij and clojure require to run successfully has eluded me, since much of the information is rather 'scattered' and I'm not sure whether I missed something along the way.
顺便说一下,整个问题的起源是因为我在安装了草书插件之后尝试在intellij中运行REPL,但是没有用。然后我猜测可能是因为我之前没有安装leiningen(我认为IDE和草书会捆绑在一起)。然而,关于intellij和clojure成功运行所需的实际信息却让我望而却步,因为很多信息都是“分散的”,我不确定我是否遗漏了一些东西。
In any case, I am having quite a hard time of getting everything to work--probably because I'm not yet that savvy when it comes to these kinds of issues, having only been on a linux distro for a short while as well as being completely unfamiliar with clojure. If I'm missing something obvious, I apologize, but it stands to reason that something can only be obvious once it is shown to be so.
在任何情况下,我都很难让一切工作 - 可能是因为我不熟悉这些类型的问题,只是在一段时间内在Linux发行版上以及对clojure完全不熟悉。如果我遗漏了一些明显的东西,我会道歉,但是有理由认为只有在证明是这样的情况下,某些东西才会显而易见。
Any and all suggestions will be greatly appreciated.
任何和所有建议将不胜感激。
1 个解决方案
#1
2
That looks like a problem caused by Java 9's new concept of "modules": Clojure expects to be able to access java.sql.Timestamp, but it can't. I haven't kept up with Java development or Clojure development, so I can't say for sure that's your problem, but it looks that way to me. Try with an earlier JDK.
这看起来像Java 9的新模块“模块”引起的问题:Clojure希望能够访问java.sql.Timestamp,但它不能。我没有跟上Java开发或Clojure开发的步伐,所以我不能肯定这是你的问题,但它看起来对我来说。尝试使用早期的JDK。
#1
2
That looks like a problem caused by Java 9's new concept of "modules": Clojure expects to be able to access java.sql.Timestamp, but it can't. I haven't kept up with Java development or Clojure development, so I can't say for sure that's your problem, but it looks that way to me. Try with an earlier JDK.
这看起来像Java 9的新模块“模块”引起的问题:Clojure希望能够访问java.sql.Timestamp,但它不能。我没有跟上Java开发或Clojure开发的步伐,所以我不能肯定这是你的问题,但它看起来对我来说。尝试使用早期的JDK。