Fork me on GitHub
#cljfx
<
2020-10-27
>
b406:10:38

anybody know how to handle this error? Syntax error (ClassNotFoundException) compiling at (cljfx/coerce.clj:1:1). javafx.event.EventHandler

b406:10:22

i don't know what i need to handle this in ubuntu.

b406:10:54

and it happen when i do (require '[cljfx.api :as fx]) in the repl.

seancorfield06:10:35

@b4 What JDK are you running on? Did you add the JavaFX dependencies to your project?

b406:10:32

java - opendjk 11, javafx.version 15.0.1

b406:10:53

should i need to add javafx into project? i just add like this.

b406:10:06

: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"}

b406:10:49

sorry im a beginer, so i try to find a some clue in the internet... but.. still not yet.

b406:10:15

plz let me know some document if there is about how to setup javafx env.

seancorfield06:10:46

Hmm, I would have expected that to work. Maybe when @vlaaad is around, he can help...

seancorfield06:10:17

When I create a new project with those deps and run a REPL and then do that require, it works 😐

seancorfield06:10:50

(! 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 ""
                 :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=> 

seancorfield06:10:21

(that's on JDK 15 but it shouldn't make any difference)

seancorfield06:10:05

(! 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.

b406:10:44

maybe my env is sth wrong. i will try again from zero. anyway thank u very much! 👍👍

vlaaad07:10:14

on java 9+ javafx deps are pulled in automatically

vlaaad07:10:33

@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

b407:10:50

@vlaaad already did it. but not working.

b407:10:13

so i delete java and re-install openjdk 15.

vlaaad07:10:37

what does clj -Stree say in your project dir?

b407:10:05

still not working so chang clojure from 1.9.0.381 -> 1.10.1.727 finally working.

seancorfield16:10:45

Clojure CLI versions are independent of Clojure versions. CLI 1.9.x is very old and a lot of changes and bug fixes have happened since then.

👍 3
b407:10:16

yes i did it in the project dir.

b407:10:40

still i don't know the reason but now it is working.

vlaaad07:10:48

ah yes, minimum clojure version is 1.10

b407:10:54

hm.. but i added clojure 1.10.1 into deps.edn.

vlaaad07:10:54

¯\(ツ)

b407:10:30

anyway thanks ur comment.! 😁

👍 3
b407:10:27

and thanks to ur cljfx @vlaaad 👍👍

vlaaad07:10:18

my pleasure 🙂

seancorfield16:10:45

Clojure CLI versions are independent of Clojure versions. CLI 1.9.x is very old and a lot of changes and bug fixes have happened since then.

👍 3