Hacker News new | ask | show | jobs
by mike_hearn 828 days ago
Usually Java apps come with Java these days, like how there's no independent way to run Electron apps, it just comes with the download of the app itself. There are tools that make it easy like jpackage and (toots my own horn) https://www.hydraulic.dev

If you want to just quickly run a fat jar then any will work. "openjdk21" is fine. The Zulu variant comes with JavaFX which simplifies things if your app needs that.

1 comments

For sure, Java developers need to use a tool like yours to distribute their app. My experience with some Java applications was that running it triggered an attempt to download (I assume) the JRE, which I cancelled as I didn't know the source of download and didn't want it to download some PUA or malware. (I remember JRE for windows used to bundle some browser toolbar on windows). Hence my attemt to install it myself beforehand. But, since Oracle has stopped distributing latest JRE through Java.com for macOS, I looked for it in MacPorts. And it is really confusing - for example, if you look at the OpenJDK-Zulu port that you recommended - https://ports.macports.org/port/openjdk21-zulu/details/ - it has 4 variants:

1. Applets ( Advertise the JVM capability "Applets".)

2.BundledApp ( Advertise the JVM capability "BundledApp". This is required by some java-based app bundles to recognize and use the JVM.)

3. JNI ( Advertise the JVM capability "JNI". This is required by some java-based app bundles to recognize and use the JVM.)

4. WebStart ( Advertise the JVM capability "WebStart".)

- what the heck? I think I am better off without Java. :)

That's a MacPorts thing, I've not seen that before and the Zulu download doesn't seem to have that. And zulu goes in for variants more than most distributors do.
My personal go-to for mac is the Liberica JDK from Bellsoft.