by pron · 5y ago · 0 comments
Not anymore. Java Web Start was removed because the very concept of a JRE, a system-wide runtime downloaded directly from Oracle and managed by the user or their IT department, no longer exists (despite some OpenJDK distributions offering something they call a JRE -- perhaps to maintain a sense of familiarity -- no one actually provides a JRE anymore, although I guess OpenWebStart is attempting to resurrect it). Like any other application, Java applications now only have two parties: the user and the application's vendor. It is the responsibility of the vendor to deliver the application along with any dependency, including a Java runtime. The vendor may choose to supply their own automatic update mechanism, for the application and the runtime, but users need not interact directly with the Java runtime anymore.
Web Start, like Applets, was entirely predicated on the notion of the JRE. With the latter gone, the former is meaningless.
Why was the JRE discontinued?
1. The software ecosystem now discourages system-wide third-party runtimes. On the desktop, the app store model rules; on the server, containers are popular -- both are much more friendly to an embedded runtime.
2. An embedded runtime with jlink gives the user a better experience by giving the software vendor full responsibility over their software and not requiring the user to deal with runtime components they don't, and need not, understand (although, admittedly, popular Java build tools currently lag in their support for jlink). In other words, the new way is better, but it does require getting used to.
> While it can in theory work with any application, it shines with modularized applications.
Not just in theory. jlink is the recommended practice for deploying any Java application, desktop or server, modular or not. While a modular application can help automate more steps of the packaging process (like not requiring running jdeps to find dependencies and automatically generating launcher scripts), jlink is not especially tied to modular applications. It is how all Java applications should be distributed (jpackage internally uses jlink).
(I work at Oracle on OpenJDK)
Yes, it would be nice to narrow down the runtime, but that is not a requirement for me and others in my situation. I deploy multiple Java applications to desktops. I have been doing so since the late 90s. Requiring my users to use a current JRE/JDK is not at all problem.
Ideally, I would have all of these apps share a common JVM so that they are not running multiple garbage collectors, but I realize this is a capability that most have simply discarded.
It is better for your applications to manage their own runtime in a way that does not interfere with others. That is not what Web Start or OpenWebStart do; what they do is discouraged, even if you are used to it, because it makes global decisions over the user's environment that apply beyond the application itself.
> Ideally, I would have all of these apps share a common JVM so that they are not running multiple garbage collectors, but I realize this is a capability that most have simply discarded.
I'm not sure that one JVM doing more work would necessarily be better than multiple ones, but since you now control the runtime, you can do that if you like. Use a launcher that runs all of your applications JARs in one VM; since you control the applications, too, you could make sure that they are well isolated.
Then what does the "java" command do exactly, if not run Java applications in some kind of runtime environment?
> It is the responsibility of the vendor to deliver the application along with any dependency, including a Java runtime.
Honestly, this appears to destroy a fundamental promise that Java made when it was first released: Write once, run anywhere. And not just in the present, but for future systems as well. Are we now expected to have vendors provide 30 different downloads tailored for every operating system and architecture combination possible? And if that application needs to be run in 10, 20 years when the packages that were made can no longer run directly?
It seems like a fairly dismal state of affairs, to me.
> 1. The software ecosystem now discourages system-wide third-party runtimes. On the desktop, the app store model rules
Does "desktop" only include Mac OS? Neither on Linux nor Windows does the "app store model" rule. They exist, but are more like an obscure "you can also do it this way" method rather than the norm.
> on the server, containers are popular -- both are much more friendly to an embedded runtime.
Containers are indeed popular, and maybe an embedded-JRE makes sense. I personally stick with installing whatever JRE package comes with Debian, myself; run them the traditional way.
It certainly clears up a lot of uncertainty about the security of whatever Java runtime is being used, when a distribution (eg, Debian, Fedora, RHEL, etc) with a reputable security team takes care of that issue for me. The Java runtime gets updated, my servers restart, instant security buff. Trusting this to software vendors is just insane.
> although, admittedly, popular Java build tools currently lag in their support for jlink
This seems to show that developers haven't bitten the Oracle dream of vendored JREs. The "old" way of launching Java applications, both desktop and server, works perfectly fine to the present day, and few seem to be willing to alter that.
if you're using a normal desktop OS there's no system-wide "java" command (anymore (thankfully))
It's just a new iteration of the eternal software cycle :
10: "apps are shipped together with all their libraries / dependencies ! space is wasted / all apps must be upgraded when there is a security issue instead of one single dll ! let's share the runtime/DLLs/whatever which will solve all our issues !"
20: "oh no ! all apps are now dependent on a single runtime/DLL which {does not updates as fast as upstream | must be installed manually by the user who is clueless and will use the competition's software which JustWorks™ instead | causes DLL hell | must be patched to work with my software in a way that would break other software using the same runtime }, let's switch to static linking / bundling everything !"
GOTO 10
Just about every Linux desktop, especially with LibreOffice installed, will have a system-wide java command. It is entirely normal and expected.
Correct. And I’m fine with that, it was a terrible idea right from the start for most use cases IMHO. If I never need to maintain a system wide Java again to run user applications I will be very happy.
The purpose of system runtimes (for Java, Python, whatever) is for running system components IMHO. User installed application dependencies beyond actual OS components are a user/vendor issue and I think the right way to handle that is on a per application basis.
Luckily, it still has that JNLP link, so I was able to get it to work. I am really glad that JNLP exists, and that they didn't use OS-specific bundle -- I am sure the latter would have been Windows only, and I don't run it.
I completely disagree. Platform dependent Java is worse than useless the same way electron made Linux support worse.
Running a complicated Electron app under wine can be very difficult and yes you will have to run electron under wine one way or another because not every company provides linux builds of their electron apps.
I do sympathise, I fully realise Electron apps are sub-par in many ways compared to native apps, but to be brutally honest that's mainly a problem for platforms that would have had native apps otherwise. For linux that's generally not the case and it's either Electron or nothing.
Now ok, maybe nothing would be preferable in some ways because it might encourage native Linux competitors, but that's pretty unlikely to work out in practice. I think it's more likely that the availability of Electron versions of popular apps makes Linux a lot more viable as a user desktop, and that could promote better Linux support generally. For example once Outlook is an Electron app there might finally be an officially supported MS Outlook client for Linux. That's huge.
Even on mac OS, how much is it the norm? I think my only app store app on my work MBP is Slack.
Well, it is a runtime, but it isn't some global environment. Just a process. It doesn't even have a concept of installation. If you have multiple runtimes, then runtime1/bin/java ... and runtime2/bin/java ... would run the program using each image's own configuration and librarary.
> Honestly, this appears to destroy a fundamental promise that Java made when it was first released: Write once, run anywhere.
I fail to see how. You write once (and you even build once; you just package multiple times) and run anywhere.
> Are we now expected to have vendors provide 30 different downloads tailored for every operating system and architecture combination possible?
The answer to your question is that that's up to the developer. If you like, you can write an updater and a launcher and package it for every architecture once, and then have it download your applications as JARs. But, if you choose not to, just remember that jlink "cross links" and the only platform-specific part of the process is the packaging.
> And if that application needs to be run in 10, 20 years when the packages that were made can no longer run directly?
Then repackage the JARs. It's as before, only more in line with how people want software delivered these days. When preferences change, the deployment process might change again.
> and maybe an embedded-JRE makes sense
It's not a JRE, just a runtime.
> I personally stick with installing whatever JRE package comes with Debian, myself; run them the traditional way.
I think you mean the JDK, and sure, developers can use the runtime in the JDK to run JARs. The new deployment process is for non-developers, who shouldn't have the JDK.
> Trusting this to software vendors is just insane.
Oh no, quite the opposite, in fact. Security vulnerabilities can and do exist in each and every component: the application, the libraries it uses, their transitive dependencies and the runtime. It's better for security for the end user to have one source in charge.
> The "old" way of launching Java applications, both desktop and server, works perfectly fine to the present day, and few seem to be willing to alter that.
Well, it's gone, though, and the new way is so much better that those that have used it don't look back. It's great! It's more secure and a better experience all around. Sure, there are those who are afraid of change, change takes time, and it's perfectly fine. They'll switch to the new, better model, each in their own pace.
"Packaging" seems to be much more part of writing than it is part of running. In particular it seems like something that has to be done by the original maintainer, rather than something that any user can do for themselves even if the original maintainer and source have disappeared, which was one of the great strengths of Java - I can download a jar that was produced by someone who disappeared 20 years ago, and have a reasonable level of confidence that it will work unmodified on my machine today.
> Oh no, quite the opposite, in fact. Security vulnerabilities can and do exist in each and every component: the application, the libraries it uses, their transitive dependencies and the runtime. It's better for security for the end user to have one source in charge.
For cases where the application vendor is a big competent organisation, maybe. For cases where the application vendor is a hobbyist who could never have maintained the dependencies or runtime on their own, not really - a lot of the time they're simply not up to providing security updates for the whole transitive closure of their dependencies on a timely schedule.
You can still do that without a JRE; in fact, it is easier because there is no central notion of a single "Java version."
> a lot of the time they're simply not up to providing security updates for the whole transitive closure of their dependencies on a timely schedule.
Right, but the JRE didn't do that, either. A well-updated runtime with an ill-maintained application and dependencies is no better than an ill-maintained application, dependencies and runtime, especially if the runtime is has a lower attack surface area.
I think what it boils down to is that b/c of Java's reflections you simply can't get rid of unused code/dependencies and things constantly bloat very fast. Small apps that should be 2MB are >20MB and are "un-emailable". On the server side this is a nonissue but to me it makes the ecosystem unsuitable for user-facing applications. There is a reason you don't see people making lil JVM desktop applications anymore.
I love writing Clojure, writing the app with CLJFX was fantastic and fun but if I wanna make a quick app to crunch some data and make some plots I'm now very hesitant to reach for the JVM. I'm hoping with GraalVM the situation will change (b/c I don't think it supports reflections/RTTI and it can prune dead code/dependencies) but last I checked it didn't work with JavaFX.
PS: I manually pruned the dependencies in `deps.edn` with `:exclusions` which helped a lot. Otherwise the app is in the ~200MB range.. But it's a manual process and tedious. The toolchains can't guarantee which code is unused. https://github.com/geokon-gh/corascope/blob/master/deps.edn
I wonder if you can then jlink the result
However what pron writes isn't to be dismissed as it sounds like Oracle/OpenJDK developers do not care anymore about backwards compatibility and looking to force people into not relying on system-wide libraries so they can start breaking things in newer versions without user-facing repercussions (i guess developer time to upgrade code doesn't matter, probably after years of webdev everyone is already accustomed to the idea of wasting time on fixing their dependencies instead of working on the task at hand :-P).
IMO this isn't a good thing as basically the biggest benefit Java always had was its stability and ability to run Java programs going back to Java 1 days (Sun even sued Microsoft about breaking JVM compatibility - and won).
Backward compatibility is of extreme importance, as always, but applications and libraries have had ways to bypass the documented API and hack into the runtime's internals. Which meant that the only way to achieve real backward compatibility was to change absolutely nothing. This is pretty much what happened for some time, not because anyone wanted it but because the investment in the platform decreased in Sun's dying days, and it took some years for Oracle to ratchet it back up. Now that the platform is under heavy development, even with the same commitment to backward compatibility, it is far from perfect because libraries have gotten used to hacking into the JDK. We are, however, taking steps to stop that, by encapsulating internals.
The new model is just better, and wasn't chosen because of this, but it is certainly another benefit.
Also, that "line" is from the actual developers who develop OpenJDK.
I can completely understand why Oracle might want to shift the Java world towards the jlink/embedded runtimes model.
I can also completely understand why folks who've been shipping .JARs out to other folks who want to run them using runtimes obtained and distributed separately, which they call JREs, and have been doing so for the past 25 years would find this claim that "JREs no longer exist" as a concept, confusing at best and disingenuous at worst.
No, not really. There are runtimes that vendors call JREs, but they don't provide the same functionality as the JRE, only that of a Java runtime. Most of the code that's made the JRE the JRE has never been open-sourced and made part of OpenJDK.
> this claim that the concept no longer exists, confusing at best and disingenuous at worst.
It's not a claim. The JRE is gone. You can scour the OpenJDK source code for the JRE bits. It's just not there. You will find, however, the JRE's worthy successor, jlink. You will also find jpackage. Of course, I didn't mean that the concept is gone from people's minds (and it seems that OpenWebStart is attempting to manifest it in their software), but it isn't in OpenJDK.
True, you can insist on asking your customers to install a Java runtime from some third party, and you can suggest that they share it among various applications, but that's not quite how the JRE used to work, it is not the recommended practice for OpenJDK, and it is confusing and disingenuous to claim that this obstinacy can conjure back the erstwhile JRE. It was great while it lasted, maybe it will come back in some other form in the future, but right now we have something different and better. In time, all Java developers will internalise this fact -- and come to enjoy it, I both hope and trust -- regardless of how long they've done things differently.
If you run multiple java apps on a single server, per-app JVM can be a problem.
[1] Here I'm talking about core JVM libraries sharing (e.g., libjvm.so), done by Linux kernel.
Zulu has a JRE (even JRE with JavaFX) which is so handy and has the added advantage of not being from Oracle.
There is a reason tooling lags support for jlink: it's a mandated "solution" that nobody asked for. Just like JPMS, another great solution from Oracle in search of a problem which is still giving fruits 4 years later.
Just an anecdote. We recently ship a CLI app companion to one of our WebApp that mostly dedup few dozen XLS files before uploading the content to the WebApp using jpackage.
We are using this Maven plugin [1] to generate an exe, a rpm and a dmg. We spent far more time figuring out how to notarize an application on MacOs that using jpackage.
Does that say more about jpackage or about the MacOS notarization process?
Theoretically, a slow but Java-optimized system could cache (components of) the JRE in memory and make those pages available to novel JRE-based executables, much like a binary shared library [0]. Was this ever done in practice? I imagine it would have sped up Java Web Start startup times considerably - and mobile platforms as well, perhaps?
[0]: see for instance https://unix.stackexchange.com/questions/458112/how-to-ensur...
- https://openjdk.java.net/jeps/310 - https://openjdk.java.net/jeps/341 - https://openjdk.java.net/jeps/350
Seems like a marketing fail - not the JRE is gone, but all the recent versions of Java without a JRE are.
From the non-developers' perspective (end users and admins), "Java" is still very much a system component. The perception is basically: The only reason it is not preinstalled is due to some legal keruffle in the Windows XP era, you don't have to care about versions because it updates itself (annoyingly). It's sad that the idea of a JRE on every device has been given up.
As to the marketing front, I would admit a failing on our part. Marketing has been centrally controlled by Oracle rather than by individual product divisions, which has made communication cumbersome, although that is now changing. This is perhaps a good time to emphasise that I'm not speaking on behalf of anyone in any official capacity, just on behalf of myself, as one of the hundreds of people working on OpenJDK at Oracle.
In any event, that is the situation and people might need to change their perception. They don't have to like the new situation, but they do need to understand it, although so far it seems that once they understand it, they also like it.
That was definitely a problem. I had some bad experiences with maven-jlink-plugin last year, and seeing that it was stuck in 3.0.0-alpha1 since 2017 did not exactly inspire confidence.
However, I just checked and the development of the plugin is now moving again: they released 3.0.0 in Novemeber and 3.1.0 in December, and the documentation has also been updated. So I guess it's time to try again...
as the jdk doe sin fact embed a jre
JRE is not discontinued still will be separate download for just a jre
https://www.oracle.com/java/technologies/javase-downloads.ht...
Conceptually I always understood the difference between the JRE and the JDK to be that "the JRE lets you run Java" and the "the JDK lets you develop Java".
To me this is the same as having libc vs. libc-dev or xlib vs xlib-dev or whatever installed.
I don't really understand the branding distinctions but I would imagine there's still room for a smaller download that lets you run .JARs without including a javac and profiler and whatever else you might want in order to develop and debug them?
[EDIT: Nevermind, I see that text all applied to Java 8 but not to Java 11 or Java 15. And implicitly as others have explained in this thread the reason being that there is no official use case for someone just wanting a JRE to run a .JAR they have; they should not just have a .JAR they should have obtained all of it together from the application vendor...]
Which Java package do I need?
Software Developers: JDK (Java SE Development Kit): For Java Developers. Includes a complete JRE plus tools for developing, debugging, and monitoring Java applications.
Administrators running applications on a server: Server JRE (Server Java Runtime Environment): For deploying Java applications on servers. Includes tools for JVM monitoring and tools commonly required for server applications, but does not include browser integration (the Java plug-in), auto-update, nor an installer. Learn more
End user running Java on a desktop: JRE: (Java Runtime Environment): Covers most end-users needs. Contains everything required to run Java applications on your system.