Hello! I'm trying to get started with cljfx and I'm running into a peculiar error: namespace 'cljfx.api' not found
I've done some basic checking and I've got the jar file in ~/.m2/repository/cljfx/cljfx/1.4.0/
, I've got the dependency listed in my project.clj as [cljfx "1.4.0"]
.
I'm using cider with emacs and I can jack in to the project, and the autocomplete knows about cljfx.api
, but when I try to require it throws a namespace not found
.
When I try calling functions directly (cljfx.api/on-fx-thread)
I get a ClassNotFoundException
(of course)
According to my repl, I'm running the right versions of stuff: ;; Clojure 1.10.0, Java 11.0.3-internal
I've not come across this sort of problem before and I thought I'd check here in case there was something obviously wrong that I was missing
Hi! Can you show your project.clj?
Also can you try running clj -Sdeps '{:deps {cljfx {:mvn/version "1.4.0"}}}'
and requiring cljfx.api from that repl to verify it's not leiningens fault?
└─> clj -Sdeps '{:deps {cljfx {:mvn/version "1.4.0"}}}'
Clojure 1.10.0
user=> (dir cljfx.api)
Execution error at user/eval140 (REPL:1).
No namespace: cljfx.api found
user=>
And here's my project.clj:
(defproject counter-gui "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "<http://example.com/FIXME>"
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "<https://www.eclipse.org/legal/epl-2.0/>"}
:dependencies [[org.clojure/clojure "1.10.0"]
[cljfx "1.4.0"]]
:main ^:skip-aot counter-gui.core
:target-path "target/%s")
I've also tried with clojure 1.10.1, but that produced the same result
Can you try 1.3.5 to validate it's not a broken version? I'm on vacation without access to computer, so can't do it right now
oh, this isn't urgent! Go back to your vacation, I can bother you later : )
Thanks :)
I would try to run clj command above with -Spath
to see what's on classpath, then verify it has cljfx jar, then try to open that jar with archiver and verify files are there
Ok, I'll mess with that. But I'm not going to tell you about the results until next week, so go have fun.
@datran checkout this
~ clj -Srepro -Sdeps '{:deps {cljfx {:mvn/version "1.4.0"}}}'
Clojure 1.10.1
user=> (System/getProperty "java.version")
"11.0.4"
user=> (dir cljfx.api)
Execution error at user/eval142 (REPL:1).
No namespace: cljfx.api found
user=> (require 'cljfx.api)
nil
user=> (dir cljfx.api)
advance-component
create-app
...
I use -Srepro
to ignore my local config and create a reproducible setup.Thanks for this tip, I found something interesting:
└─> clj -Srepro -Sdeps '{:deps {cljfx {:mvn/version "1.4.0"}}}'
Clojure 1.10.0
user=> (System/getProperty "java.version")
"1.8.0_212"
That's an old version of the jdk, so I think I have some spelunking to do. I think this is a very promising avenue, though.
I've been integrating TestFX with cljfx, progress so far: