Any experience in creating uberjar files on Linux for a Windows target? I'd like to do all my Dev etc in Linux but be able to package for Windows target (incl native libs etc). Anyone tried that?
I did 🙂 cljfx does not specify classifiers when depending on javafx, and correct one is picked for current platform. for other platform you should specify platform-specific classifiers explicitly
like that [org.openjfx/javafx-base "12" :classifier "win"]
also you might want to exclude openjfx dependencies in cljfx so it wont package linux native libs in addition to windows ones
See full list of javafx deps in https://github.com/cljfx/cljfx/blob/master/deps.edn
If you don't use web view, you might as well exclude it completely. I didn't try it, but chances are cljfx might still be able to work 🙂
Cool. This what I just started. With aliases for linux/win to force the dependencied
Sounds like I'm on the right path
Sweet, got it working.
i'm pretty stuck on packaging my app for distribution for various OS
I tried to use packr but it looks like it doesn't really support JDK 11+
I know you mentioned jlink; is it fairly easy to get started? I can't really spend more than a day on this
@vlaaad do you AOT all of your app before packaging it?
@lilactown jlink is a tool to slim down jdk to make it packageable, not a packaging tool itself.
I think @sundbp can share his experience since he did the same recently?
yeah. I guess I assumed that you were also using some other tools for packaging, and wasn't sure if jlink + <insert packaging tools> would be something I could get working
I'm just creating executable uberjars (using capsule), don't package the jre with it
Don't need "install" and prefer the simple single jar.
the problem is that I don't think any of my users have JDK 11 installed
I heard there is an alpha version of jpackager tool distributed by gluon, maybe take a look at it?
i'm trying that now
I created an uberjar with no AOT, and tried using jpackager
I get
Exception: java.lang.Exception: Error: Modules are not allowed in srcfiles: [target/app-fx-ui-0.0.1-SNAPSHOT-standalone.jar].
Ugh, sorry, don't know how to help, I'd just try to google this error...
ok 😬 thanks
Can you run this uberjar?
yes
Maybe just create a zip with jdk, uberjar and platform-specific executable that runs this jar with this jdk?
That's what we do:)
hm yeah i'll try that
bbl
alright yeah, throwing the jre + the uberjar in a zip is only 80mb. i haven't checked to make sure it runs on someone else's box yet tho
how do I add a handler for when the exit button is clicked on a stage?
ah OK, reading slack history on-close-request
I tried this:
:on-close-request (fn [_]
(shutdown-agents)
(Platform/exit))
and I get:
Exception in thread "JavaFX Application Thread" java.lang.IllegalStateException: Not on FX application thread; currentThread = JavaFX Application Thread
the error message is a bit confusing, but the gist is that I need to ensure it's run on the correct thread. how do?
ah, fx/on-fx-thread
🙂
hm. same error