This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-12
Channels
- # announcements (2)
- # architecture (1)
- # aws (22)
- # babashka (2)
- # beginners (39)
- # bristol-clojurians (2)
- # cider (1)
- # clj-kondo (12)
- # cljfx (75)
- # cljs-dev (16)
- # clojure (51)
- # clojure-berlin (1)
- # clojure-france (4)
- # clojure-nl (2)
- # clojure-norway (36)
- # clojurescript (5)
- # community-development (8)
- # data-science (1)
- # datomic (4)
- # emacs (4)
- # fulcro (7)
- # jobs-discuss (7)
- # juxt (1)
- # nrepl (3)
- # off-topic (38)
- # reitit (1)
- # ring (7)
- # sci (79)
- # shadow-cljs (5)
- # sql (15)
- # tools-deps (22)
- # uncomplicate (7)
- # vrac (1)
- # xtdb (18)
@vlaaad I had to add {:aot :all :injections [(javafx.application.Platform/exit)]}
to my uberjar
properties in project. But now I have another problem. For some reason the process is not terminating after closing the window. I still can see it in my htop...
You can set implicit exit to true to make it terminate the vm on closing the last window
Tnhx. I will rty right now
It's not helping. Should I add something to :on-close-request of stage ?
I can share access to the source code in GitLab
I gave an access with <mailto:[email protected]|[email protected]> You should see an invite. All the code in pdf-only-export
branch, in gui.clj
and app.clj
file
Do you mean you can't see code on gitlab? I have guest access Sorry for late reply... For some reason I can't see notifications on phone
Or you can add some permission to guest accounts... I don't know gitlab well enough :)
ok. sorry for a late reply again. I just gave a developer access.
@UKG0SELQY I managed to aot-compile your example so it exits the jvm when the windows is closed, there were a couple things missing:
Thanks a lot
1. in the main ns I added this to ns form:
(:import [javafx.application Platform])
(:gen-class)
2. in the -main
fn in main ns I added (Platform/setImplicitExit true)
3. in project.clj
, I added this to :uberjar
profile:
:jvm-opts ["-Dcljfx.skip-javafx-initialization=true"]
4. I removed ^:skip-aot
from project.clj
5. I bumped cljfx version to latest (1.7.9). It is very important for aot because skipping cljfx initialization was added in a later version than what you had specified 🙂I will try right now
Thnx. Now it works as expected on close. I had :jvm-opts outside of :uberjar... May be that's also the problem
Best lib maintainer in my life.
I'm unemployed/ I promise that I'll send one-time 20$ from my first salary.
I have one more question. It might be out of your competence. When I pack it with uberjar and run on Windows I see the exception: "A java exception has occured". And that's all basically. Nothing more. Is it connected to cljfx?
This example app doesn't use leiningen, but the jpackage part of the packaging is independent from the build tool, i.e. it works on uberjar
when i run it on windows cli I have:
"Graphics Device initialization failed for : d3d, sw" Problem
Exception. It seems to be connected to this (https://stackoverflow.com/questions/55561986/how-to-solve-the-graphics-device-initialization-failed-for-d3d-sw-problem) question.I'm a total newbie in java-related-devops.
java -jar jarname.jar
That's the strange. Thing. It feels like it's not standalone.
I build on ubuntu.
Won't that work on Win? I thought that's the goal of java....
Sheeeet
even though jar is cross-platform, this cross-platformness is only about the class files
it also configured it’s maven dependencies in a way that automatically selects the jars for the OS we resolve maven deps for
How can I set that up?
Is that possible
there are 2 ways around: 1. make sure you build jars for different platforms on different platforms. Example hacker news app I posted earlier has example of github actions that do it. Perhaps gitlab has similar infrastructure you can use? 2. force maven to include dependencies for all platforms. this means you will have a really fat jar that has platform-specific libraries for every platform. You do this by specifying ALL javafx classifiers as dependencies
we do this in Defold editor: https://github.com/defold/defold/blob/editor-dev/editor/project.clj#L81-L108
sorry for late reply
So you build them with 3rd services (github can build platform-specific, for windows)?
Cool. I'm a retrograde
I can see that's kinda complicated stuff with a lot of yaml... Are you using CircleCI? Could you please share a piece of that code? So I
have a little representation at least.
Ok. Tnhx.
Do you still have some config-yaml?
Oh.thnx. I didn't knew that's the workflow dir on that