GPL license for Hotspot VM forbid non-GPL JNI coding?
Volker Simonis
volker.simonis at gmail.com
Fri Oct 16 09:44:39 PDT 2009
Hi Martin,
this question pops up every now and then and there have been already
quite some discussions on the list about this topic, most noticeably
here: "OpenJDK and JNI -- licensing"
(http://mail.openjdk.java.net/pipermail/discuss/2009-July/thread.html#1308)
The bottom line so far is the following:
- "jni.h" which is part of t he VM has the "classpath exception" (see
http://hg.openjdk.java.net/jdk7/jdk7/hotspot/file/tip/src/share/vm/prims/jni.h)
- if you want to start the VM trough JNI, you have to compile your
program against "jni.h", but that's no problem (because of the
classpath exception of "jni.h")
Now there's only the question of if you can "dynamically" load/link
the VM from your program and there are two contradictory positions
here. Florian Weimer explained this nicely in the previously mentioned
mail thread: "..There are two conflicting lines of thoughts regarding
GPLed program loaders: The first one says that loaded programs are not
subject to the loader's GPL license. This is the stance taken by the
Linux folks for their kernel. The second one says that the loaded
program has to be GPLed as well. This one is sometimes cited in the
Emacs Lisp context (meaning that anything which runs on Emacs has to
be GPLed)..."
Sun has its own interpretation which was explained by Martin Buchholz:
"..I imagine some lawyer at Sun thought as follows: Whether an API is
a published standard influences whether or not a client of that API is
considered a separate work or not. Most (but not all) of the
interfaces to hotspot are specified by a JCP standard (and that
includes jni), and this standard has multiple implementations, so it
is reasonable to presume that linking with hotspot is not creating a
separate program, when not using the non-standard interfaces (like
sun.misc.Unsafe). One can further presume that one can use any
interfaces for which the interface specification file (e.g. a C header
file) has the Classpath exception..."
The only real outcome of the mentioned discussions was that you won't
get any more precise answer from Sun lawyers anytime soon. So feel
free to choose your own interpretation:)
Regards,
Volker
On 10/16/09, martin.strassburger at t-online.de
<martin.strassburger at t-online.de> wrote:
> Hi team leads,
>
> I would like to address the following license issue in the case
> a non-GPL application wants to use the openjdk implementation.
>
> The openjdk project provides the Hotspot Java VM with GPL v2 license
> and the JDK with GPL v2 + Classpath exception, so that it is possible
> to run a Java program which is non-GPL licensed.
> see http://www.sun.com/software/opensource/java/faq.jsp#g6
> (Why do you need the Classpath exception)
>
> The Java runtime can be started per 'java' executable or by
> Java native interface call JNI_CreateJavaVM().
> http://java.sun.com/javase/6/docs/technotes/guides/jni/spec/invocation.html
> The Hotspot Java VM license is GPL v2 (not LGPL or extended with something like
> classpath exception).
>
> Hence is it intended that all programs starting the Hotspot Java runtime
> per JNI call must be released with GPL license?
> Does this also mean that JNI coding can not be used without GPL license?
> Because all this links the VM library dynamically?
>
> I assume, that the GPL license for the Hotspot VM was chosen because
> VM extensions should be available for everyone.
>
> I assume, that the intension is not to make the JNI interface unuseable
> for non-GPL applications.
>
> Could you please clarify?
>
> Best regards,
>
> Martin Strassburger
>
>
>
More information about the hotspot-dev
mailing list