Fork me on GitHub
#cursive
<
2019-04-08
>
sparkofreason14:04:10

Cross-posting from #rebl: Trying to run REBL from within Cursive. It works fine from the command line, so I think my deps.edn is correct, but when using the setup for cursive from the REBL wiki I'm getting java.lang.ClassNotFoundException: javafx.fxml.FXMLLoader

thumbnail19:04:03

I noticed the console doesn’t do \r correctly; but it seems like a IntelliJ issue (https://youtrack.jetbrains.com/issue/IDEA-147282). are there known workarounds?

joshkh19:04:53

i have a clojurescript nrepl running via shadow cljs. i've followed the guide [1] and can connect just fine, but cursive complains when i try to load a cljs name space: Cannot load ClojureScript file into Clojure REPL. is there a way around this? 🙂 [1] https://github.com/thheller/shadow-cljs/wiki/Cursive

manutter5119:04:26

@joshkh there’s a little dropdown menu in the toolbar at the top of the REPL window that you can change from CLJ to CLJS to let cursive know what’s on the other end of your nrepl.

joshkh20:04:17

nice! okay, that got me a little farther, but now there's another error: No reader function for tag js:

(ns server.main)

(defn handler [_ _ cb]
  (cb nil
      #js {:statusCode 200
           :body       (js/JSON.stringify "Hello!")}))
Loading src/server/main.cljs... 
Syntax error reading source at (main.cljs:6:53).
No reader function for tag js

cfleming21:04:54

@holyjak re: your question about the datomic stubs jar, that is no longer required in recent Cursive versions. Instead, you’ll be prompted to build the stubs automatically when using datomic and other similar libraries.

👍 4
cfleming21:04:18

@dave.dixon I’ll try to reproduce that today.

sparkofreason21:04:18

FYI, seems to work with Java 8. Unfortunately, REBL doesn't render correctly in Java 8 on a HiDPI display.

cfleming21:04:11

@dave.dixon When you run your REPL, you can look at the classpath used by un-folding the second line in the console. Are the JavaFX jars there?

cfleming21:04:02

I can’t see why it wouldn’t be able to find that class then - that’s very strange.

sparkofreason22:04:12

Is this maybe the issue of a long classpath getting truncated on windows?

sparkofreason22:04:41

But it works from the command line, so maybe not.

cfleming22:04:26

There’s an option to control that in the run configuration - if you think that might be the problem, try “classpath file” under “Shorten command line”.

sparkofreason22:04:06

Maybe a classloader issue? Here's part of the info that is shown with the exception: Caused by: java.lang.ClassNotFoundException: javafx.fxml.FXMLLoader at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:398) at clojure.lang.RT.classForName(RT.java:2207) at clojure.lang.RT.classForNameNonLoading(RT.java:2220) at cognitect.rebl.renderers$loading__6706__auto____12012.invoke(renderers.clj:3) at cognitect.rebl.renderers__init.load(Unknown Source) at cognitect.rebl.renderers__init.<clinit>(Unknown Source) ... 71 more

cfleming21:04:39

@jeroen.dejong I don’t think so, unfortunately.

sparkofreason21:04:29

I have a local REPL that insists on running clojure 1.9. Running at the command line using clj runs 1.10. Double-checked the various deps.edn files, where else would I look?

cfleming21:04:15

@dave.dixon Oh, you’re using the “Use t.d.a directly” REPL option on Windows, right? I just realised that I haven’t updated the bundled system deps.edn, so that will be pulling in Clojure 1.9. I’ll fix that, and also make it overridable so that you can choose another file if required.

cfleming21:04:55

In the meantime, one workaround is to specify the Clojure version in either your user deps.edn or your project one.

👍 4