With Oracle's shuttering of their Java runtime distribution (the January release will be the last version available for commercial use without a paid license) many people are recommending the use of one of various distributions based on OpenJDK, which was released under the GPLv2 with the Classpath Exception. For example, I might consider installing the AdoptOpenJDK JRE in place of Oracle's runtime.

However, taken at face value, the GPL doesn't appear to allow the use of the OpenJDK runtime to run a third-party closed-source Java application, as per this FAQ entry. If I'm reading it correctly, you would be fine provided the Java application in question does not use JNI or any similar mechanism, but of course I have no way of telling whether or not that is the case for any given third-party application with a dependency on the Java runtime.

Applications developed with JDK 11 should ship with their own runtime built in, but many older applications depend on having a Java runtime already installed. In a large enterprise, replacing all of these applications is likely to be implausible (or at the very least very difficult and quite possibly rather expensive) which leaves us in a bit of a pickle.

Can a Java runtime derived from OpenJDK be legally used to replace the Oracle Java runtime when running third-party non-GPL-compatible applications?

up vote 3 down vote accepted

You are correct that under a plain GPL license, a runtime like the JRE/JDK would only allow the use of open-source applications with a GPL-compatible license.

However, the classpath exception to the GPL, which is used by OpenJDK, is designed exactly to ensure that the GPL requirements of the OpenJDK do not influence the license choices of Java applications that run on top of the OpenJDK code, as long as the two interoperate in the conventional way.

This means that, yes an OpenJDK based runtime can be used as a replacement for the Oracle Java runtime without having to change the license on your application.

  • I did look at that clause, but it seemed to be intended for people using the JDK to develop and distribute their own applications. I suppose it is plausible that it also permits using the JRE to run third-party applications, depending on which source files are covered by it. Upvoted, but do you have any references? – Harry Johnston Dec 6 at 18:43
  • @HarryJohnston: I don't have an explicit reference, but the linking that the classpath exception refers to is performed by the JRE at runtime. For that reason, it covers not only developers using OpenJDK but also end-users running Java applications on top of OpenJDK. – Bart van Ingen Schenau Dec 7 at 7:26

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.