anybody know how to handle this error? Syntax error (ClassNotFoundException) compiling at (cljfx/coerce.clj:1:1). javafx.event.EventHandler
i don't know what i need to handle this in ubuntu.
and it happen when i do (require '[cljfx.api :as fx]) in the repl.
@b4 What JDK are you running on? Did you add the JavaFX dependencies to your project?
java - opendjk 11, javafx.version 15.0.1
should i need to add javafx into project? i just add like this.
:deps {org.clojure/clojure {:mvn/version "1.10.1"} org.openjfx/javafx-controls {:mvn/version "15"} org.openjfx/javafx-base {:mvn/version "15"} org.openjfx/javafx-graphics {:mvn/version "15"} org.openjfx/javafx-media {:mvn/version "15"} org.openjfx/javafx-web {:mvn/version "15"} cljfx {:mvn/version "1.7.10"}
sorry im a beginer, so i try to find a some clue in the internet... but.. still not yet.
plz let me know some document if there is about how to setup javafx env.
Hmm, I would have expected that to work. Maybe when @vlaaad is around, he can help...
When I create a new project with those deps and run a REPL and then do that require, it works 😐
(! 617)-> cat deps.edn
{:paths ["src" "resources"]
:deps {org.clojure/clojure {:mvn/version "1.10.1"}
org.openjfx/javafx-controls {:mvn/version "15"}
org.openjfx/javafx-base {:mvn/version "15"}
org.openjfx/javafx-graphics {:mvn/version "15"}
org.openjfx/javafx-media {:mvn/version "15"}
org.openjfx/javafx-web {:mvn/version "15"}
cljfx {:mvn/version "1.7.10"}}
:aliases
{:test {:extra-paths ["test"]
:extra-deps {org.clojure/test.check {:mvn/version "1.0.0"}}}
:runner
{:extra-deps {com.cognitect/test-runner
{:git/url "<https://github.com/cognitect-labs/test-runner>"
:sha "b6b3193fcc42659d7e46ecd1884a228993441182"}}
:main-opts ["-m" "cognitect.test-runner"
"-d" "test"]}
:uberjar {:extra-deps {seancorfield/depstar {:mvn/version "1.1.128"}}
:main-opts ["-m" "hf.depstar.uberjar" "fx.jar"
"-C" "-m" "b4.fx"]}}}
(! 618)-> clj
Clojure 1.10.1
user=> (require '[cljfx.api :as fx])
nil
user=>
(that's on JDK 15 but it shouldn't make any difference)
(! 619)-> JAVA_HOME=$OPENJDK11_HOME clj
Clojure 1.10.1
user=> (System/getProperty "java.version")
"11.0.5"
user=> (require '[cljfx.api :as fx])
nil
user=>
Yup, works on openjdk 11 too.maybe my env is sth wrong. i will try again from zero. anyway thank u very much! 👍👍
on java 9+ javafx deps are pulled in automatically
@b4, could it be that you used java 8 when creating the project, i.e. run clj ...
on java 8 so it created and cached a classpath using java 8, and then switched to java 15? In that case you need to use -Sforce
or just remove the caches manually
@vlaaad already did it. but not working.
so i delete java and re-install openjdk 15.
what does clj -Stree
say in your project dir?
still not working so chang clojure from 1.9.0.381 -> 1.10.1.727 finally working.
yes i did it in the project dir.
still i don't know the reason but now it is working.
ah yes, minimum clojure version is 1.10
hm.. but i added clojure 1.10.1 into deps.edn.
¯\(ツ)/¯
anyway thanks ur comment.! 😁
and thanks to ur cljfx @vlaaad 👍👍
my pleasure 🙂