r/programming • • May 28 '19

A boost for Java on the Client

https://gluonhq.com/a-boost-for-java-on-the-client/
52 Upvotes

10 comments sorted by

12

u/renatoathaydes May 28 '19

TL;DR they created a Maven (and Gradle) plugin that uses OpenJDK, OpenJFX and GraalVM to compile desktop apps written in JavaFX to native code. It's all open-source. In the future (when?), it will also capable of generating mobile apps from the same code.

1

u/metamatic May 29 '19

Can anyone cite some examples of JavaFX applications that look good?

0

u/[deleted] May 28 '19

[deleted]

2

u/PedDavid May 28 '19

But a pain to setup in my experience. (Or maybe I'm just trying something that I shouldn't).

I'm yet to manage to start a project using Gradle winh kotlin DSL and Java 9(+) modules

3

u/inyourgroove May 29 '19

I have been struggling with this today, still didn't get it working. But I did come across this note on the gradle docs:

While Gradle version 5.4.1 doesn’t have first-class support for Java 9 modules yet, this guide shows you how to experiment with them before that support is complete.

0

u/[deleted] May 28 '19

[deleted]

3

u/[deleted] May 28 '19

3

u/Chii May 28 '19

Presumably they want to finish support for other OS's first before merging everything.

Looks exciting - may be this toolset can unseat the dominant position of electron for native client

4

u/[deleted] May 29 '19

Yeah in the few times I've used JavaFX, it was a pleasant experience.

I hope the devs behind the plugin can get the binary size smaller though. Their JavaFX example is about 80 MB. One of my JavaFX applications with a JVM runtime is 50MB due to jlink and proguard. The startup time is noticeable though, native compilation would make it much shorter.

I look forward to trying the plugin when it comes out for windows and linux.

3

u/pron98 May 29 '19

If you care about startup time, make sure you use Application CDS. It is constantly being improved and about to be more automatic in JDK 13.