Closed LukeDefeo closed 6 years ago
Did you require the nashorn
namespace first?
Seemingly I have the same problem while I try to use Clojure CLI Here is the info:
With deps.edn in empty folder and ~/.m2 being removed
deps.edn
{:deps {
org.clojure/clojure {:mvn/version "1.9.0"}
org.clojure/clojurescript {:mvn/version "1.10.339"}
org.clojure/tools.nrepl {:mvn/version "0.2.13"}
cider/piggieback {:mvn/version "0.3.6"}
}}
Java version
$ java --version
java 9.0.1
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)
Start repl
$ clj
Downloading: org/clojure/clojure/1.9.0/clojure-1.9.0.pom from https://repo1.maven.org/maven2/
Downloading: org/clojure/clojurescript/1.10.339/clojurescript-1.10.339.pom from https://repo1.maven.org/maven2/
Downloading: org/sonatype/oss/oss-parent/7/oss-parent-7.pom from https://repo1.maven.org/maven2/
Downloading: org/clojure/tools.nrepl/0.2.13/tools.nrepl-0.2.13.pom from https://repo1.maven.org/maven2/
Downloading: org/clojure/pom.contrib/0.2.2/pom.contrib-0.2.2.pom from https://repo1.maven.org/maven2/
Downloading: cider/piggieback/0.3.6/piggieback-0.3.6.pom from https://repo.clojars.org/
Downloading: org/clojure/spec.alpha/0.1.143/spec.alpha-0.1.143.pom from https://repo1.maven.org/maven2/
Downloading: org/clojure/core.specs.alpha/0.1.24/core.specs.alpha-0.1.24.pom from https://repo1.maven.org/maven2/
Downloading: com/google/javascript/closure-compiler-unshaded/v20180610/closure-compiler-unshaded-v20180610.pom from https://repo1.maven.org/maven2/
Downloading: com/google/javascript/closure-compiler-main/v20180610/closure-compiler-main-v20180610.pom from https://repo1.maven.org/maven2/
Downloading: com/google/javascript/closure-compiler-parent/v20180610/closure-compiler-parent-v20180610.pom from https://repo1.maven.org/maven2/
Downloading: org/sonatype/oss/oss-parent/9/oss-parent-9.pom from https://repo1.maven.org/maven2/
Downloading: org/clojure/google-closure-library/0.0-20170809-b9c14c6b/google-closure-library-0.0-20170809-b9c14c6b.pom from https://repo1.maven.org/maven2/
Downloading: org/clojure/data.json/0.2.6/data.json-0.2.6.pom from https://repo1.maven.org/maven2/
Downloading: org/clojure/pom.contrib/0.1.2/pom.contrib-0.1.2.pom from https://repo1.maven.org/maven2/
Downloading: org/mozilla/rhino/1.7R5/rhino-1.7R5.pom from https://repo1.maven.org/maven2/
Downloading: org/clojure/tools.reader/1.3.0-alpha3/tools.reader-1.3.0-alpha3.pom from https://repo1.maven.org/maven2/
Downloading: com/cognitect/transit-clj/0.8.309/transit-clj-0.8.309.pom from https://repo1.maven.org/maven2/
Downloading: com/google/javascript/closure-compiler-externs/v20180610/closure-compiler-externs-v20180610.pom from https://repo1.maven.org/maven2/
Downloading: args4j/args4j/2.33/args4j-2.33.pom from https://repo1.maven.org/maven2/
Downloading: args4j/args4j-site/2.33/args4j-site-2.33.pom from https://repo1.maven.org/maven2/
Downloading: org/kohsuke/pom/14/pom-14.pom from https://repo1.maven.org/maven2/
Downloading: com/google/errorprone/error_prone_annotations/2.0.18/error_prone_annotations-2.0.18.pom from https://repo1.maven.org/maven2/
Downloading: com/google/errorprone/error_prone_parent/2.0.18/error_prone_parent-2.0.18.pom from https://repo1.maven.org/maven2/
Downloading: com/google/guava/guava/22.0/guava-22.0.pom from https://repo1.maven.org/maven2/
Downloading: com/google/guava/guava-parent/22.0/guava-parent-22.0.pom from https://repo1.maven.org/maven2/
Downloading: com/google/protobuf/protobuf-java/3.0.2/protobuf-java-3.0.2.pom from https://repo1.maven.org/maven2/
Downloading: com/google/protobuf/protobuf-parent/3.0.2/protobuf-parent-3.0.2.pom from https://repo1.maven.org/maven2/
Downloading: com/google/google/1/google-1.pom from https://repo1.maven.org/maven2/
Downloading: com/google/code/gson/gson/2.7/gson-2.7.pom from https://repo1.maven.org/maven2/
Downloading: com/google/code/gson/gson-parent/2.7/gson-parent-2.7.pom from https://repo1.maven.org/maven2/
Downloading: com/google/code/findbugs/jsr305/3.0.1/jsr305-3.0.1.pom from https://repo1.maven.org/maven2/
Downloading: com/google/jsinterop/jsinterop-annotations/1.0.0/jsinterop-annotations-1.0.0.pom from https://repo1.maven.org/maven2/
Downloading: com/google/jsinterop/jsinterop/1.0.0/jsinterop-1.0.0.pom from https://repo1.maven.org/maven2/
Downloading: org/sonatype/oss/oss-parent/4/oss-parent-4.pom from https://repo1.maven.org/maven2/
Downloading: org/clojure/google-closure-library-third-party/0.0-20170809-b9c14c6b/google-closure-library-third-party-0.0-20170809-b9c14c6b.pom from https://repo1.maven.org/maven2/
Downloading: com/cognitect/transit-java/0.8.332/transit-java-0.8.332.pom from https://repo1.maven.org/maven2/
Downloading: com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.pom from https://repo1.maven.org/maven2/
Downloading: com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.pom from https://repo1.maven.org/maven2/
Downloading: org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.pom from https://repo1.maven.org/maven2/
Downloading: org/codehaus/mojo/animal-sniffer-parent/1.14/animal-sniffer-parent-1.14.pom from https://repo1.maven.org/maven2/
Downloading: org/codehaus/mojo/mojo-parent/34/mojo-parent-34.pom from https://repo1.maven.org/maven2/
Downloading: org/codehaus/codehaus-parent/4/codehaus-parent-4.pom from https://repo1.maven.org/maven2/
Downloading: com/fasterxml/jackson/core/jackson-core/2.8.7/jackson-core-2.8.7.pom from https://repo1.maven.org/maven2/
Downloading: com/fasterxml/jackson/jackson-parent/2.8/jackson-parent-2.8.pom from https://repo1.maven.org/maven2/
Downloading: com/fasterxml/oss-parent/27/oss-parent-27.pom from https://repo1.maven.org/maven2/
Downloading: org/msgpack/msgpack/0.6.12/msgpack-0.6.12.pom from https://repo1.maven.org/maven2/
Downloading: commons-codec/commons-codec/1.10/commons-codec-1.10.pom from https://repo1.maven.org/maven2/
Downloading: org/apache/commons/commons-parent/35/commons-parent-35.pom from https://repo1.maven.org/maven2/
Downloading: org/apache/apache/15/apache-15.pom from https://repo1.maven.org/maven2/
Downloading: com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.pom from https://repo1.maven.org/maven2/
Downloading: org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA.pom from https://repo1.maven.org/maven2/
Downloading: com/cognitect/transit-java/0.8.332/transit-java-0.8.332.jar from https://repo1.maven.org/maven2/
Downloading: org/clojure/data.json/0.2.6/data.json-0.2.6.jar from https://repo1.maven.org/maven2/
Downloading: org/clojure/clojure/1.9.0/clojure-1.9.0.jar from https://repo1.maven.org/maven2/
Downloading: commons-codec/commons-codec/1.10/commons-codec-1.10.jar from https://repo1.maven.org/maven2/
Downloading: com/google/errorprone/error_prone_annotations/2.0.18/error_prone_annotations-2.0.18.jar from https://repo1.maven.org/maven2/
Downloading: org/clojure/core.specs.alpha/0.1.24/core.specs.alpha-0.1.24.jar from https://repo1.maven.org/maven2/
Downloading: org/clojure/spec.alpha/0.1.143/spec.alpha-0.1.143.jar from https://repo1.maven.org/maven2/
Downloading: org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar from https://repo1.maven.org/maven2/
Downloading: com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar from https://repo1.maven.org/maven2/
Downloading: org/clojure/google-closure-library/0.0-20170809-b9c14c6b/google-closure-library-0.0-20170809-b9c14c6b.jar from https://repo1.maven.org/maven2/
Downloading: org/clojure/clojurescript/1.10.339/clojurescript-1.10.339.jar from https://repo1.maven.org/maven2/
Downloading: com/google/jsinterop/jsinterop-annotations/1.0.0/jsinterop-annotations-1.0.0.jar from https://repo1.maven.org/maven2/
Downloading: com/fasterxml/jackson/core/jackson-core/2.8.7/jackson-core-2.8.7.jar from https://repo1.maven.org/maven2/
Downloading: org/mozilla/rhino/1.7R5/rhino-1.7R5.jar from https://repo1.maven.org/maven2/
Downloading: org/clojure/google-closure-library-third-party/0.0-20170809-b9c14c6b/google-closure-library-third-party-0.0-20170809-b9c14c6b.jar from https://repo1.maven.org/maven2/
Downloading: com/google/javascript/closure-compiler-externs/v20180610/closure-compiler-externs-v20180610.jar from https://repo1.maven.org/maven2/
Downloading: org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA.jar from https://repo1.maven.org/maven2/
Downloading: org/clojure/tools.nrepl/0.2.13/tools.nrepl-0.2.13.jar from https://repo1.maven.org/maven2/
Downloading: com/google/guava/guava/22.0/guava-22.0.jar from https://repo1.maven.org/maven2/
Downloading: org/msgpack/msgpack/0.6.12/msgpack-0.6.12.jar from https://repo1.maven.org/maven2/
Downloading: com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar from https://repo1.maven.org/maven2/
Downloading: com/cognitect/transit-clj/0.8.309/transit-clj-0.8.309.jar from https://repo1.maven.org/maven2/
Downloading: args4j/args4j/2.33/args4j-2.33.jar from https://repo1.maven.org/maven2/
Downloading: org/clojure/tools.reader/1.3.0-alpha3/tools.reader-1.3.0-alpha3.jar from https://repo1.maven.org/maven2/
Downloading: com/google/javascript/closure-compiler-unshaded/v20180610/closure-compiler-unshaded-v20180610.jar from https://repo1.maven.org/maven2/
Downloading: com/google/protobuf/protobuf-java/3.0.2/protobuf-java-3.0.2.jar from https://repo1.maven.org/maven2/
Downloading: cider/piggieback/0.3.6/piggieback-0.3.6.jar from https://repo.clojars.org/
Downloading: com/google/code/findbugs/jsr305/3.0.1/jsr305-3.0.1.jar from https://repo1.maven.org/maven2/
Downloading: com/google/code/gson/gson/2.7/gson-2.7.jar from https://repo1.maven.org/maven2/
Clojure 1.9.0
user=>
Classpath
$ clj -Spath | sed -e 's/:/\'$'\n/g'
src
/Users/sbondaryev/.m2/repository/com/cognitect/transit-java/0.8.332/transit-java-0.8.332.jar
/Users/sbondaryev/.m2/repository/org/clojure/data.json/0.2.6/data.json-0.2.6.jar
/Users/sbondaryev/.m2/repository/org/clojure/clojure/1.9.0/clojure-1.9.0.jar
/Users/sbondaryev/.m2/repository/commons-codec/commons-codec/1.10/commons-codec-1.10.jar
/Users/sbondaryev/.m2/repository/com/google/errorprone/error_prone_annotations/2.0.18/error_prone_annotations-2.0.18.jar
/Users/sbondaryev/.m2/repository/org/clojure/core.specs.alpha/0.1.24/core.specs.alpha-0.1.24.jar
/Users/sbondaryev/.m2/repository/org/clojure/spec.alpha/0.1.143/spec.alpha-0.1.143.jar
/Users/sbondaryev/.m2/repository/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.jar
/Users/sbondaryev/.m2/repository/com/googlecode/json-simple/json-simple/1.1.1/json-simple-1.1.1.jar
/Users/sbondaryev/.m2/repository/org/clojure/google-closure-library/0.0-20170809-b9c14c6b/google-closure-library-0.0-20170809-b9c14c6b.jar
/Users/sbondaryev/.m2/repository/org/clojure/clojurescript/1.10.339/clojurescript-1.10.339.jar
/Users/sbondaryev/.m2/repository/com/google/jsinterop/jsinterop-annotations/1.0.0/jsinterop-annotations-1.0.0.jar
/Users/sbondaryev/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.8.7/jackson-core-2.8.7.jar
/Users/sbondaryev/.m2/repository/org/mozilla/rhino/1.7R5/rhino-1.7R5.jar
/Users/sbondaryev/.m2/repository/org/clojure/google-closure-library-third-party/0.0-20170809-b9c14c6b/google-closure-library-third-party-0.0-20170809-b9c14c6b.jar
/Users/sbondaryev/.m2/repository/com/google/javascript/closure-compiler-externs/v20180610/closure-compiler-externs-v20180610.jar
/Users/sbondaryev/.m2/repository/org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA.jar
/Users/sbondaryev/.m2/repository/org/clojure/tools.nrepl/0.2.13/tools.nrepl-0.2.13.jar
/Users/sbondaryev/.m2/repository/com/google/guava/guava/22.0/guava-22.0.jar
/Users/sbondaryev/.m2/repository/org/msgpack/msgpack/0.6.12/msgpack-0.6.12.jar
/Users/sbondaryev/.m2/repository/com/google/j2objc/j2objc-annotations/1.1/j2objc-annotations-1.1.jar
/Users/sbondaryev/.m2/repository/com/cognitect/transit-clj/0.8.309/transit-clj-0.8.309.jar
/Users/sbondaryev/.m2/repository/args4j/args4j/2.33/args4j-2.33.jar
/Users/sbondaryev/.m2/repository/org/clojure/tools.reader/1.3.0-alpha3/tools.reader-1.3.0-alpha3.jar
/Users/sbondaryev/.m2/repository/com/google/javascript/closure-compiler-unshaded/v20180610/closure-compiler-unshaded-v20180610.jar
/Users/sbondaryev/.m2/repository/com/google/protobuf/protobuf-java/3.0.2/protobuf-java-3.0.2.jar
/Users/sbondaryev/.m2/repository/cider/piggieback/0.3.6/piggieback-0.3.6.jar
/Users/sbondaryev/.m2/repository/com/google/code/findbugs/jsr305/3.0.1/jsr305-3.0.1.jar
/Users/sbondaryev/.m2/repository/com/google/code/gson/gson/2.7/gson-2.7.jar
Setup handler
user=> (require '[clojure.tools.nrepl.server :as server])
nil
user=> (require '[cider.piggieback :as pback])
nil
user=> (server/start-server :handler (server/default-handler #'pback/wrap-cljs-repl))
#clojure.tools.nrepl.server.Server{:server-socket #object[java.net.ServerSocket 0x586728e8 "ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=58990]"], :port 58990, :open-transports #object[clojure.lang.Atom 0x745926c3 {:status :ready, :val #{}}], :transport #object[clojure.tools.nrepl.transport$bencode 0x75dd0f94 "clojure.tools.nrepl.transport$bencode@75dd0f94"], :greeting nil, :handler #object[clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__577 0x72324965 "clojure.tools.nrepl.middleware$wrap_conj_descriptor$fn__577@72324965"], :ss #object[java.net.ServerSocket 0x586728e8 "ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=58990]"]}
Try to setup repl-env
user=> (pback/cljs-repl (cljs.repl.nashorn/repl-env))
CompilerException java.lang.ClassNotFoundException: cljs.repl.nashorn, compiling:(NO_SOURCE_PATH:6:18)
user=> (require '[cljs.repl.nashorn :as nashorn])
nil
user=> (pback/cljs-repl (nashorn/repl-env))
IllegalStateException Can't change/establish root binding of: *cljs-repl-env* with set clojure.lang.Var.set (Var.java:223)
In the first case you didn't require nashorn.
In the second case you used the CLI Tools and attempted to start it without being in an nREPL env.
Go back to the lein
example and require nashorn before you try to start a cljs REPL.
@bbatsov this is a case of literally following the usage example in the README
Yeah, yeah. I know. I meant to update it after seeing the issue, but I forgot about this.
Hello i am a bit of a noob at this but here goes:
i want to run a clojurescript repl and eval a few things in it from my editor.
i added this to my profiles.clj
and other relavent versions: [org.clojure/clojure "1.9.0"] [org.clojure/clojurescript "1.10.238"] java version "1.8.0_162"
when i run
i get