r/JavaFX • • Oct 31 '26

Help JavaFX Environment

Ok, I'm a bit of an old JavaFX hobbyist. I started about 10 years ago in college and keep using it for my personal projects.

Nowadays, I feel it's so much harder to configure the environment. Even with AI help, there's always an "if this, then that." I mean, as I remember, you used to just install Eclipse with e(fx)clipse, install Scene Builder, and in the end, just generate a .jar file. Now, I can't find a guide from start to deploy that doesn't look like a workaround. And with every Java/JavaFX update, some detail changes.

How do you configure your environment to make it easier? I mean IDE, embedded DB, how to deploy, and how to distribute (I see there are some frameworks that compile JavaFX to web apps).

19 Upvotes

14 comments sorted by

11

u/idontlikegudeg Oct 31 '26

Use a JDK with JavaFX included: Liberica JDK Full or Azul JDKFX.

1

u/V_Bifi Oct 31 '26

and generate a runtime image with jlink? I tried it, but it breaks when I use embedded H2. :/

2

u/idontlikegudeg Oct 31 '26

How do you use jlink? It should work. Is your code open?

1

u/V_Bifi Oct 31 '26

It was just a POC. I used H2 and jlink as Maven dependencies. I think the problem was that the H2 project is multi-modular and jlink doesn't work with it. There might be a way to do it, but it's unofficial.

3

u/idontlikegudeg Oct 31 '26

If you can share your POC on GitHub (or similar), I could look into it. But I’d probably change the build to Gradle as I am obviously in the Gradle camp (I maintain a jlink plugin for Gradle).

2

u/V_Bifi Nov 01 '26

Oh, so you really can help me! I think it was a problem with jlink for Maven. I deleted the project before spending all day trying to build it, haha. I'll create it again and send it to you.

1

u/hippydipster 19d ago

H2 is particularly difficult to deal with if you are using java modules.

6

u/Siedlerchr Oct 31 '26

Intellij idea, javafx as maven dependeny declared, jpackage for distribution

3

u/CodeDead-gh JavaFX Fan Nov 01 '26

I find it pretty reasonable and easy using Gradle and the javafx plugin.

I've got a project that uses jlink to include the javafx modules in the build for each platform using any JDK vendor. A simple gradle.build from my project can be found here, to help you get started:
https://github.com/CodeDead/opal/blob/master/build.gradle

1

u/mkalbde Nov 01 '26

I used the plugin too. But it is outdated and not compatible with newer gradle version. I replaced it with own configuration.

1

u/CodeDead-gh JavaFX Fan Nov 01 '26

The JavaFX plugin works just fine on Gradle v9.8.2 (as demonstrated in the repo above), which is the latest stable release of Gradle as of now. What do you mean by it's incompatible? What error message are you getting?

1

u/mkalbde Nov 01 '26

Yes, it works with 9.x. But I received a depreciation warning.

Invocation of Task.extensions at execution time has been deprecated. This will fail with an error in Gradle 10.
This API is incompatible with the configuration cache, which will become the only mode supported by Gradle in a future release.

3

u/mkalbde Nov 01 '26

There exists a kickstarter app. But I didn’t used it yet.

https://www.reddit.com/r/JavaFX/s/e5xQSVBFyw

1

u/lazystone Nov 01 '26

But also check the license.