Hacker News new | ask | show | jobs
by dymk 722 days ago
Wouldn’t you need to have a JVM installed to deploy a JavaFX app? Is there something for bundling self-contained Java apps easily?
1 comments

The JDK now supports building standalone executables.

https://docs.oracle.com/javase/9/tools/javapackager.htm#JSWO...

Problem is that the entire runtime is packaged. Nice for large enterprise solutions, but not for small apps. And if I remember correctly the memory footprint isn't nice either.
But most popular modern desktop apps also bring the whole runtime packaged, just not Java (Node.js / Chromium) (Slack: 120MB, 1password: 136MB, Discord: 103MB).

So I don't see much a difference actually. 30MB is not a lot anymore, not for network, not for disk.

You can trim down the runtime[1] but the tooling around doing this is non-existent / unreliable. Alternatively, you can generate native binaries with GraalVM[2] which comes with its own baggage (license, slow compile time, etc).

[1]: https://docs.oracle.com/javase/8/embedded/develop-apps-platf...

[2]: https://www.graalvm.org/

Would this generate ~150mb images like the similarly-named jpackage or is it possible to trim down the runtime?
Yes, but Electron apps are about the same size: (Slack: 120MB, 1password: 136MB, Discord: 103MB).

But it was a problem in dial-up times, so maybe JavaFX appeared too early, when 150MB was not ok.

And Python runtime is about 20MB, but it's kinda assumed it's already installed (who knows which version though, for Python it's important, not so much with Java). Maybe Sun also expected their target audience to eventually have a JRE already installed on end-user machines.