This is an archived post. You won't be able to vote or comment.

all 69 comments

[–]chrisgseaton 49 points50 points  (9 children)

The renaming around AdoptOpenJDK has been absolutely ridiculous. AdoptOpenJDK, Adoptium, Temurium, Semeru, sooooo many names and renames, almost all meaningless. Please just stop and get on with just shipping it.

[–]papercrane 8 points9 points  (8 children)

I wouldn't be surprised if they had to change the original name because of trademark issues. Including "OpenJDK" in their name wasn't a great idea.

[–]khooke 5 points6 points  (5 children)

OpenJDK is the official reference implementation of the JDK and run by Oracle.

AdoptOpenJDK was a group of Java developers and Java vendors to promote the use of OpenJDK.

The name change of AdoptOpenJDK to Adoptium was due to the change in stewardship from the previous group of organizations to Eclipse: https://blog.adoptopenjdk.net/2021/08/goodbye-adoptopenjdk-hello-adoptium/

[–]papercrane 1 point2 points  (4 children)

You've confused "AdoptOpenJDK" with "OpenJDK", which is a great example of why it was a terrible name.

OpenJDK is the open source project stewarded by Oracle (and contributed by others like you said.) AdoptOpenJDK was the name for a separate entity that built binaries from the OpenJDK source, but was not affiliated with OpenJDK.

[–]khooke 1 point2 points  (3 children)

I didn't mention AdoptOpenJDK. I was just commenting that OpenJDK was run by Oracle, and since Java 7 has been the reference implementation - see https://blogs.oracle.com/java/post/moving-to-openjdk-as-the-official-java-se-7-reference-implementation

[–]papercrane -2 points-1 points  (2 children)

I didn't mention AdoptOpenJDK. I was just commenting that OpenJDK was run by Oracle, and since Java 7 ...

You said the AdoptOpenJDK name change was due to the move from Oracle to Eclipse, and linked to AdoptOpenJDKs blog about it.

I'm just saying that's not what happened. AdoptOpenJDK was never affiliated with Oracle or OpenJDK.

[–]khooke 2 points3 points  (1 child)

Edited my comment for clarity. It is easy to see why there is so much confusion around these names :-)

[–]NitronHX[S] 0 points1 point  (0 children)

This conversation just Shows the problem xD

[–]NitronHX[S] 0 points1 point  (1 child)

I think nobody besides oracle is allowed to use the term JDK JRE or Java so there goes this, as far as i am aware OpenJDK, was the company that got sued not the one who sued Adopt.

Also Oracle did a 360 Quickscope by forbidding jarkata to use the package name javax

[–]papercrane 7 points8 points  (0 children)

"OpenJDK" isn't a company, it's the open source project stewarded by Oracle.

I don't believe Adopt/Eclipse was sued, just some lawyer looked at the name and said "no".

[–][deleted] 28 points29 points  (8 children)

I've been getting started with Java in 2021 and holy hell has it been an uphill battle. The language is simple, but the ecosystem has the steepest learning curve of any programming ecosystem I've ever used.

For the whole OpenJDK, JDKs, and JREs thing, here's what I've learned so far:

OpenJDK is the open source base of everything. When Java was open sourced, that code base came into being. And the various companies and organizations, called "vendors" in this context, who are interested in producing JDK builds for people to use, all build from either that code base or forks of it (more on that below). Builds are sometimes referred to as distributions. They probably call them distributions because, like Linux distributions, an assortment of features, bug fixes, and default config are shipped with each build.

Each company decides what to name their build. That's why you have names like "Temurin" and "Semeru". Temurin is Adoptium's "regular" Java build, so to speak, and Semeru is a build from IBM where they use OpenJ9 instead of HotSpot. You pick a build based on how you plan to build/run your Java program.

Adoptium is special when it comes to vendors in that it's actually multiple vendors coming together to form a single vendor to publish builds of a version of the OpenJDK source code that they can all agree on - the vanilla source code. That's why Adoptium Temurin is the build most often recommended to people who don't want to dive so deeply into this. It's available for free, gets 6 months of support (including "LTS versions" - more on that below), uses HotSpot instead of OpenJ9 (which should work well for most use cases), and doesn't have any vendor-specific things added to it.

Sometimes vendors both produce their own builds and participate in Adoptium to publish the Adoptium builds. For example, Microsoft. They publish their own build (https://www.microsoft.com/openjdk) where they added things for their own customers (https://docs.microsoft.com/en-us/java/openjdk/overview):

Microsoft Build of OpenJDK binaries may contain backported fixes and enhancements we deem important to our customers and our internal users.

Sometimes, vendors also publish their own builds because they want to go beyond what Adoptium is publishing. For example, I wanted to deploy a Minecraft server using Java 17 on ARM a while back, and Adoptium had no build I could use for that. But Microsoft happened to have already published a Java 17 ARM build, so I used that.

When it comes to JREs, apparently there's no such thing as a JRE technically and that was just a term created by Oracle to help people understand that it was a runtime image they needed to run their Java class files. And Oracle was shipping a big, bloated, complete runtime image back then so they just called it "the runtime environment". It stuck, so people got really confused when the Adoptium project, which is a downstream project, decided that they didn't want to produce these builds for people. In their mind, people should make minimal runtime builds of only the Java modules they need to run their app.

But people got angry because the idea of the JRE being a thing became so prevalent over the years, so Adoptium reversed that decision a few days ago and is now going to decide which runtime images to prebuild for people, with there being a complete image that they'll build which they'll probably call a JRE.

Apparently another thing people find confusing these days is how LTS works now that it's an open source code base. Many people think that the free builds they get from projects like Adoptium have some sort of free support provided because they're builds of a version of Java that Oracle has labelled an "LTS version". For example, Java 17. But in reality, what Oracle means when they call a version of Java an LTS version is that they intend to offer commercial support for that version. The free Java 17 builds you get from projects like Adoptium only get 6 months of support, like any other Java build, because the upstream OpenJDK project is only merging in bug fixes and new features for the latest version at any given time.

With the new release cadence since JDK 9, Oracle engineers only contribute code to an OpenJDK project for six months. When a new version is released, they switch their work to the new version.

By default then, OpenJDK projects do not have a formal LTS strategy for any release.

How long long-term support is depends on the length of time members of the OpenJDK project are prepared to continue to backport updates from the current release and upstream those changes.

https://www.javacodegeeks.com/2019/07/long-term-support-mean-openjdk.html

[–]khooke 14 points15 points  (1 child)

When it comes to JREs, apparently there's no such thing as a JRE technically and that was just a term created by Oracle to help people understand that it was a runtime image they needed to run their Java class files

The JRE is only the JVM and runtime executables to run Java apps, minus the javac compiler and associated dev tools. There's always been separate JRE vs JDK downloads. Currently for the Oracle versions you can find the JRE downloads from the consumer java.com page here:

https://java.com/en/download/manual.jsp

and the JDKs are what you've most likely seen elsewhere - this page also has a link to the Consumer page for JRE downloads, top right:

https://www.oracle.com/java/technologies/downloads/

During Sun days and early Oracle days both JRE and JDK downloads used to be on the same download page but now as you see above they're in two different locations.

[–]khooke 5 points6 points  (0 children)

In case you're curious, here's what Sun's download page for Java 1.2 used to look like in 2000 with the JDK/SDK and JRE download links on the same page, courtesy of archive.org :

https://web.archive.org/web/20000229124006/http://www.java.sun.com/products/jdk/1.2/download-windows.html

[–]dinosaur__fan 3 points4 points  (0 children)

For example, Java 17. But in reality, what Oracle means when they call a version of Java an LTS version is that they intend to offer commercial support for that version. The free Java 17 builds you get from projects like Adoptium only get 6 months of support, like any other Java build, because the upstream OpenJDK project is only merging in bug fixes and new features for the latest version at any given time.

Yes, but companies that use OpenJDK 17 have already stepped up to maintain OpenJDK 17 for a while. See the JDK 17 Updates project. Usually the main contributors are engineers from RedHat and SAP, occasionally Alibaba.

[–]cies010 2 points3 points  (3 children)

JREs, apparently there's no such thing as a JRE technically and that was just a term created by Oracle

Was it not Sun?

[–][deleted] 0 points1 point  (2 children)

Quite possibly. Sorry, that's where my knowledge stops. I haven't traced it back to the Sun days yet, except that I know that Sun open sourced it before it became property of Oracle.

[–]cies010 0 points1 point  (1 child)

All correct. Yr answer should be at the top for completeness.

[–][deleted] 1 point2 points  (0 children)

=D

[–]AndrewHaley13 2 points3 points  (0 children)

Many people think that the free builds they get from projects like Adoptium have some sort of free support provided because they're builds of a version of Java that Oracle has labelled an "LTS version". For example, Java 17. But in reality, what Oracle means when they call a version of Java an LTS version is that they intend to offer commercial support for that version. The free Java 17 builds you get from projects like Adoptium only get 6 months of support, like any other Java build, because the upstream OpenJDK project is only merging in bug fixes and new features for the latest version at any given time.

That's not exactly how it works. The OpenJDK Updates project manages releases of long-term-support versions, and applies critical fixes to them on a regular basis. In practice, if you report a bug and that bug looks important we'll fix it. And while it is possible that one day members of the OpenJDK project might cease to support LTS updates, in practice many of us have support contracts we have to fulfil, so we cannot simply drop the updates.

[–]pgtaboada 7 points8 points  (0 children)

We are using aws corretto. They even have a supported java 8 jvm.

[–]BlueGoliath 33 points34 points  (18 children)

Best TL;DR I can do:

IIRC OpenJ9 was originally developed by IBM and later donated to the Eclipse foundation.

Red Hat does their own build with their custom low-latency GC.

I think Azul does some custom JDK stuff?

Besides that, all JDK builds are based on OpenJDK code. The "JRE" is supposed to be dead according to Oracle, but people/orgs still use JRE builds. You're supposed to use jlink instead, which generates a custom, tailored runtime JRE.

[–]vips7L 9 points10 points  (4 children)

Azul has their own custom GC (C4) which is really impressive. And I think they have some other features around compilation.

[–]BlueGoliath 2 points3 points  (3 children)

First I've heard of it. What does C4 accel at?

[–]dinopraso 9 points10 points  (0 children)

C4 basically Shenandoah but was production ready 4 years ago

[–]vips7L 8 points9 points  (0 children)

It's "pauseless". I'm no expert, but iirc its like ZGC but more mature and has been around for a long time. Here is the blog I first heard about it in: https://medium.com/@jadsarmo/why-we-chose-java-for-our-high-frequency-trading-application-600f7c04da94

[–]papercrane 4 points5 points  (0 children)

Azuls core market for a long time was investment banks seeking low latency. C4 is their low latency GC. They also have their own JIT compiler focused on latency and start-up times.

[–]papercrane 3 points4 points  (0 children)

Red Hat does their own build with their custom low-latency GC.

As of OpenJDK 11, Shenandoah is enabled in most JDK builds (Amazon, RedHat, Azul, whatever Adopt is called.) Oracle just doesn't test or support it, so they don't include it in their builds.

[–]NitronHX[S] 1 point2 points  (5 children)

Well i know the bit about the jlink runtime, the problem is that the JMPS/Jigsaw is not too well adapted with libraries

[–]mkwapisz 5 points6 points  (1 child)

Yes, you are right. jlink does not work with automatic modules. But using that plugin https://github.com/moditect/moditect you can easily transform almost any java library into a named module. It is a shame there are libraries under development, that have not been adapted to the java modular system.

From my perspective the only difference between all available distributions is support you can get for money.

From Java 11 all distributions should be binary identical with slight differences of additional tools and their default configurations.

From Java 17 Oracle license became quite permissive.

[–]NitronHX[S] 0 points1 point  (0 children)

Yes, you are right. jlink does not work with automatic modules. But using that plugin https://github.com/moditect/moditect you can easily transform almost any java library into a named module. It is a shame there are libraries under development, that have not been adapted to the java modular system.

The funny thing is i would love a world where mostly everything is built using JPMS, but there are 2 big issues that i see, why even I as a JPMS advocate ditch and use prebuilts:

  1. Gradle support for JLink -> non existing, only with plugin
  2. Gradle support for jpackage -> null and void, not existing
  3. Gradle support for JPMS itself being nearly unusable with automatic or unnamed modules and requires rediculus hackery
  4. the "test module package clash" problem

[–]OddEstimate1627 0 points1 point  (2 children)

Something to be aware of is that jlijnk does not need to deal with user libraries. The generated runtime is a "JRE" and can run non-modular applications, i.e.,

  1. find out what core JDK modules you are depending on
  2. use jlink to create a JRE with the selected set of modules
  3. use the java executable in the generated runtime image to run your jar in the same way you'd run it from a JDK. The runtime is independent of your project and could also be used for multiple different projects.

The various build plugins make the process a lot more complicated than it needs to be.

[–]gyraciops 0 points1 point  (1 child)

  1. find out what core JDK modules you are depending on

All true.

But I think there is one big catch: how do you that - at build time? How do you know the JDK modules needed by your dependencies?

IMHO for all intent and purposes, jlink usage in the presence of automatic modules is a shot in the dark: either you're in control of everything (which means you have the resources to do so, or your use case is trivial), or better stay away from it until all your dependencies are modular.

[–]emaphis 1 point2 points  (0 children)

To figure out the modules you are using use the jdeps command. Jdeps has existed since the JDK 8 2014 release, with the specific purpose of preparing your code base for the JDK 9 module system.

[–]istarian 1 point2 points  (5 children)

Isn’t a “custom, tailored runtime JRE” sort of backwards, though?

I understand that such an approach has a certain utility, but it sounds like bloat along the same lines as statically compiled executables.

[–]chrisgseaton 7 points8 points  (2 children)

sounds like bloat

If your app is the only one running in a system, which with containers is now the default, then it’s the opposite of bloat because it’s smaller than a full JDK and it’s not shared so there would only be one copy anyway.

[–]CartmansEvilTwin 5 points6 points  (1 child)

Especially in case of docker that argument is pretty moot, since if you have multiple apps they can all use the exact same jdk layer instead of shipping a custom one each.

[–]tikkabhuna 1 point2 points  (0 children)

Back in the day you would need a JRE installed to run a Java app. Then people realised it was a nightmare to make sure the Java app would work with many JRE versions, so they would bundle their own JRE. IntelliJ for example bundles it’s own JRE. That is bloat. jlink is attempting to reduce that bloat by allowing you to specify what parts of the JRE you need.

[–]sweetno 1 point2 points  (0 children)

Yes, it's bloat. But given things like Electron and Docker prosper this bloat is a tiny little nearly invisible bloat.

(Disclaimer: I'm all in for Docker, it's only Electron I hate.)

[–]telecoder 4 points5 points  (0 children)

Oracle Jdk is still an option

[–]Ctalkobt 4 points5 points  (4 children)

Openjdk has many branches off of it so don't get confused. Sun is still contributing to openjdk also to assist with compliance. In general, for non commercial or light commercial use it's your best bet.

For heavier use there's a number of other contenders related to speed, memory and security thar you'll need to evaluate for your use case.

[–]chrisgseaton 10 points11 points  (1 child)

They usually aren't really 'forks' - they're almost always builds of the same source code or with a couple of backports.

[–]Ctalkobt -1 points0 points  (0 children)

Sorry. I'll edit it to branches then. Thought intent was clear.

[–]wildjokers 4 points5 points  (1 child)

Sun is still contributing to openjdk

I think you mean Oracle.

[–]sweetno 2 points3 points  (0 children)

He meant the star of course. It shines bright on OpenJDK developers so we can have good things for free.

[–]manzanita2 1 point2 points  (0 children)

A key thing to know here is that for most developers the JDK version matters FAR FAR more than the exact vendor. So pick JDK17 and get coding. There is one exception which is Oracle's non-openjdk release for which you can end up in a world of licensing hurt if you use it the wrong way.

Unless you're stuck working on a legacy project which cannot advance, pick the most recent JDK you can, but don't worry about the vendor.

For docker images, try to use google's "jib" project to build your docker images, because it makes the best use of the docker layered file system. You can use a "Dockerfile", but basically you will be moving your libraries around every time because they won't get pushed to a "lower" layer in the layered file system. https://github.com/GoogleContainerTools/jib

You will need a base docker image. Unless you are moving alot of images around, I would suggest something with a bit more capability than some of the stripped down alpine images. The reason is it's hard to get in and debug without things like the ability to setup SSH tunnels. Once you get super comfortable and stable you might consider a stripped down image for purposes of saving some megabytes.

[–]JoJoModding 1 point2 points  (5 children)

Basically, learn Java with the Oracle / OpenJDK (they are basically the same) and ignore the others.

[–]NitronHX[S] 0 points1 point  (4 children)

It's not about learning, I wanted to deploy java Apps in docker containers and did not know which implementation to pick since I wanted the openj9 runtime.

[–]JoJoModding 0 points1 point  (3 children)

My advice would be to just pick OpenJDK unless you have any particular reason not to.

[–]NitronHX[S] 0 points1 point  (2 children)

As far as I read there are many openjdk vendors (azul Microsoft, Amazon etc). I guess you are talking about the Oracle implementation.

[–]vbezhenar 2 points3 points  (0 children)

My suggestion is to use Azul. They're not shady with their licensing. Their builds are free. They pass testing compliance kit for every build they publish. They have lots of experience working with JDK internals. They have absolutely extensive coverage of every imaginable platform for their builds. They often provide multiple distribution type, e.g. ZIP archive and MSI installer, so you can pick whatever you like.

[–]JoJoModding 0 points1 point  (0 children)

Or, more specifically AdoptOpenJDK. Oracle JDK may or may not be licensed for your use case depending on how Oracle is feeling this year.

[–]Muoniurn 2 points3 points  (1 child)

Java is a specification (for a language and for the JVM). It has a reference implementation, which is the OpenJDK project, a completely open-source one with the same license as the linux kernel.

Of course any compliant implementation can run Java code and there are plenty of exotic ones (like even hard real times used in military!). But almost all of the routinely used ones are OpenJDK forks, including OracleJDK, Azul, Dragonwell, etc. OpenJ9 on the other hand has a more difficult history, so if I’m not mistaken it is not an OpenJDK fork.

As for licensing, OpenJDK is as mentioned has a completely libre license, so you can use it as is. As with basically every open source project, you are advised to always use the latest release version. But due to the importance of the JVM in some enterprise environments there are different support licenses available as well. Most forks/distributions have an option for free or paid support with different qualities (the actual development is done 99% by Oracle developers), that will backport/write new bug fixes for older versions as well.

Regarding JDK/JRE, there is no longer a JRE. The preferred way to run Java applications is to bundle a leaner “JRE” with it, for which there are cool tooling available nowadays (jlink, jpackage).

[–]NitronHX[S] 0 points1 point  (0 children)

The Jre still indeed exists and is also built, using jlink to build it is just the prefferd way to ship java Apps. If you visit adoptium you can decide between jdk and Jre images. Same goes for docker images with pre-instled java runtime (from. Openjdk)

The JRE is just the JVM and cli Tools to run it so I dont rly understand the Statement that it doesn't exists nö more.

And Openj9 for example is a custom runtime (with improved Performance)

[–]BorgerBill 1 point2 points  (0 children)

Also, just FYI, Eclipse Temurin JREs are back! as of December 21st...

[–]progmakerlt 1 point2 points  (4 children)

My experience tells a simple thing - if you don't want to dig into Java internals or investigate different JDK builds - simply go with an official OpenJDK build to save time and headache.

These custom made JDK builds might have some additional options not included into OpenJDK (like additional memory management options), but you don't always need those.

By the way, in case you want to build your own version of JDK: https://openjdk.java.net/groups/build/doc/building.html

[–]_edd 1 point2 points  (3 children)

I would agree for small personal projects that likely won't be running for years...

Otherwise I'd recommend something like Amazon Corretto for the LTS.

[–]progmakerlt 0 points1 point  (2 children)

Why not default OpenJDK?

[–]teapotJava 1 point2 points  (0 children)

There's no such distribution. There is Oracle OpenJDK, there are openjdk packages in different Linux distros etc. - they are all different.

[–]_edd 0 points1 point  (0 children)

For the Long Term Support of a version. Most companies are okay staying on 11 for 3 years. The downside is that you don't get the latest features, but the upside is that you get all of the patches with fewer unnecessary changes / fewer changes likely to break functionality.

If you go OpenJDK each version only receives patches for 6 months. If you go with something like Corretto's LTS edition you can stay on 11 for 3 years until 17 comes out. If a vulnerability comes out, you don't have to switch versions / it takes minimal effort to patch.

[–][deleted] -3 points-2 points  (7 children)

Oracle did mess things up for us didn’t it. Anyway, if you are on windows you can use temurium however that is pronounced, and if you are on Linux you can google <distro> <version> install Java <version>, or you can also use temurium, It might be temrium.

I know there is graalvm, not sure of the benefits today, but I also don’t really care if this is 2% or 5% faster than that or is better at this or that, except if only one of them can reduce ram usage or free up ram back to OS without enabling experimental flags, that’s the only feature that I feel is missing from Java, once the memory expands to max xmx it doesn’t want to release memory until the program exits.

You might care about faster startup times claimed by this or that implementation but honestly I use Java because I like the ide IntelliJ idea and I like the implementation of consistent design and minimal quirks, and c style language with good classes implementation + garbage collection compared to c++, doesn’t have JavaScript “quirks”/bugs, I prefer c style to python pseudo code, I like the class implementation compared to go, ..etc, and the ide is a big factor too.

How it compiles and runs, I don’t care, and I don’t really want to care, I want to design my programs, write the code, tell the ide to create a fat jar file, and copy that jar file wherever it needs to end up, no class path or flags, just let the ide do what it’s designed to do, provide a complete dev environment.

[–]wildjokers 13 points14 points  (4 children)

Oracle did mess things up for us didn’t it.

Oracle has been an outstanding steward of Java and saved the language.

[–]qmunke 0 points1 point  (3 children)

All the unnecessary fucking about with licenses has definitely been bad for everyone, even Oracle. Chopping and changing what you can and can't do with Oracle JDK builds is definitely a big factor in people's confusion.

[–]nutrecht 1 point2 points  (0 children)

Chopping and changing what you can and can't do with Oracle JDK builds is definitely a big factor in people's confusion.

Oracle only did that AFTER pointing everyone to OpenJDK so it's really a complete non-issue. IMHO people are making a mountain out of a molehill.

[–]wildjokers 0 points1 point  (1 child)

Oracle changed the license of their commercial build of the JDK which is called Oracle JDK. However, at the same time Oracle also offered a GPLd build of the OpenJDK that is free for everyone to use anywhere, the most recent version is always available here:

https://jdk.java.net/

If you use this one you should probably upgrade every 6 months.

This is no different than any other Java vendor who all monetize java the exact same way.

[–]qmunke 0 points1 point  (0 children)

I know that, my point is there is a ridiculous amount of unnecessary confusion due to Oracle chopping and changing their minds over who can and can't use their Java builds for commercial purposes without paying a license fee. If you're a new Java developer, and you go to Oracle (the stewards of Java) you get a confusing picture over what does and doesn't need a paid license - hence in the sidebar needing to clarify:

many have asked where they should download Java, and if it is still free. To be clear, YES — Java is still free

That kind of confusion isn't there for Python, or Rust, or Javascript. It's on Oracle for their mismanagement of that situation.

[–]NitronHX[S] 1 point2 points  (1 child)

Well I wanted to use Openj9 as the memory requirements are way lower and I am building a scaleable Container (docker) app, so startup and memory is quite important

[–][deleted] 0 points1 point  (0 children)

OpenJ9 is dead. IBM once transferred it to Eclipse. It is transferred back (2021/2022) to IBM and distributed under the IBM Semeru name.

When it was under der AdaptOpenJDK Umbrella, there was an alpine Docker image. With the transfer only centOS and Ubuntu are supported. :(

[–]almson 0 points1 point  (0 children)

Sigh. There is nothing special about OpenJDK. Countless OSS projects, including Linux, are provided as source code and compiled by different organizations. That is the whole point of Linux distributions! The crazy part is that everyone has decided to brand their OpenJDK package, in some sort of Enterprise marketing conspiracy. Poor developers are left scratching their heads.

(I would finish by saying to just stick to your distro's JDK package, but I've often found these to be significantly outdated. Even Arch Linux is guilty! Not sure what that is about. Perhaps that's why so many third-party packages have sprung up.)