Question

With the current developments regarding Oracle announcing its intention to charge for a pro (or whatever you call it) version of JVM, and IBM announcing its intention to support OpenJDK, things are getting quite complicated for a large set of Java developers. We have a large piece of work in Java, and we did not have any issues in choosing our licensing terms up until now. It appears that we'll have to switch to OpenJDK where IBM will be putting their support. But OpenJDK is GPL V2, and as far as I know, any code linking to GPL V2 must be GPL V2. We also have some JNI code, which is going to get even larger. Given these facts, does it mean that if we use OpenJDK to run our software, we'll have to switch to GPL for our licensing? Needless to say, this would blow away our whole licensing & business model setup.

Was it helpful?

Solution

The license for OpenJDK is not "GPL v2", it's "GPL v2 with the Classpath Exception". Quote:

As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library.

OTHER TIPS

Do I need to open my source code if I use OpenJDK as JVM?

Absolutely not.

There are many commercial, closed-source Java applications out there that use OpenJDK-based JVMs. The "Classpath exception" that @Chris Lercher mentions specifically makes this legal.

Incidentally, the "Classpath exception" was invented by FSF's lawyers specifically to allow the GNU Classpath libraries (a cleanroom reimplementation of the Java SE libraries) to be used to run proprietary / closed source applications. Hence, the name ...

The only cases where you would need to worry are things like:

  • Closed source JVMs that use the OpenJDK codebase.
  • Closed source applications that contain modified copies of OpenJDK classes without including source code for the modifications.
  • Closed source applications that link to certain OpenJDK GPLv2 classes that are not marked as with the Classpath exception.

In OpenJDK 11, the last category seems to consist of a large number of "test" classes that are not included in an OpenJDK distro anyway, and internal classes that you shouldn't (and probably can't) link to in an application. These classes are easy to identify. Search for Java source files in the OpenJDK source tree that contain the word "GNU" and not the word "Classpath"

It is worth noting that a significant proportion of the OpenJDK Java code base is 3rd-party code with permissive open source licenses. Linking to those classes is permitted.

Bundling OpenJDK with closed-source is not a problem. The GPL permits you to distribute binaries for GPL software together with binaries for closed source software.

Please read the lines at the beginning of the classpath exception. The classpath exception doesn't seem to apply to the entire library.

Certain source files distributed by Sun Microsystems, Inc. are subject to the following clarification and special exception to the GPL, but only where Sun has expressly included in the particular source file's header the words "Sun designates this particular file as subject to the "Classpath" exception as provided by Sun in the LICENSE file that accompanied this code."

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top