我是一个Clojure新手,正在尝试学习clj工具。我正在遵循这个https://betweentwoparens.com/start-a-clojurescript-app-from-scratch教程,在执行命令clj -A:dev
时出现了以下错误
Downloading: com/google/protobuf/protobuf-java/3.0.2/protobuf-java-3.0.2.jar from central
Downloading: com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar from central
Downloading: com/google/code/gson/gson/2.7/gson-2.7.jar from central
Exception in thread "Thread-4" java.net.SocketException: Broken pipe (Write failed)
at java.base/java.net.SocketOutputStream.socketWrite0(Native Method)
at java.base/java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:110)
at java.base/java.net.SocketOutputStream.write(SocketOutputStream.java:150)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:167)
at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:102)
at cljs.repl.server$send_and_close.invokeStatic(server.clj:168)
at cljs.repl.server$send_and_close.invoke(server.clj:144)
at cljs.repl.browser$send_static.invokeStatic(browser.clj:205)
at cljs.repl.browser$send_static.invoke(browser.clj:178)
at cljs.repl.server$dispatch_request.invokeStatic(server.clj:191)
at cljs.repl.server$dispatch_request.invoke(server.clj:182)
at cljs.repl.server$handle_connection.invokeStatic(server.clj:199)
at cljs.repl.server$handle_connection.invoke(server.clj:195)
at cljs.repl.server$server_loop$fn__68.invoke(server.clj:209)
at clojure.core$binding_conveyor_fn$fn__5754.invoke(core.clj:2030)
at clojure.lang.AFn.run(AFn.java:22)
at java.base/java.lang.Thread.run(Thread.java:834)
为什么我会得到这个错误?我的环境
在Mac OSX Mojave上虚拟的Ubuntu 18.04无头。
[I] /home/user/tallex~> java -version
openjdk version "11.0.6" 2020-01-14 LTS
OpenJDK Runtime Environment Corretto-11.0.6.10.1 (build 11.0.6+10-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.6.10.1 (build 11.0.6+10-LTS, mixed mode)
我也试过用
[I] /home/sporty/software~> java -version
openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment (build 11.0.6+10-post-Ubuntu-1ubuntu118.04.1)
OpenJDK 64-Bit Server VM (build 11.0.6+10-post-Ubuntu-1ubuntu118.04.1, mixed mode, sharing)
结果是相同的。
编辑:这个问题是因为CLJ无法打开浏览器,因为我正在运行无头Ubuntu。所以我添加了主机端口转发,这似乎可以启动X窗口浏览器。