Search code examples
javaopen-source

Is Oracle JDK not an open source project?


I read at Technically what is the main difference between Oracle JDK and Open JDK? the

"Oracle JDK is an implementation of the OpenJDK and is not open source"

But JDK source code is openly available and free . Right . So how come its not open source ? May be i am wrong here in judging the oracle JDK as open source because source code may be available and free but is it not allowed to modify/extend and redistribute it further, that why it is not open source ?


Solution

  • But [the Oracle] JDK source code is openly available and free. Right?

    Strictly speaking, No.

    1) The full source code for the Oracle JDK is not available. The JDK source code ZIP file only contains the source code for the public class library APIs. Not some of the "internal" class. Not the JDK / JRE toolchains. Not the JVM runtime itself; e.g. the JIT compiler, GC implementations, the verifier, etc.

    2) For the subset that is available you need to accept an Oracle license.

    3) The source code that is available says in the copyright headers that it is Oracle (or Sun) proprietary.

    So how come its not open source?

    See above.

    May be i am wrong here because source code may be available and free but is it not allowed to modify/extend and redistribute it further, that why it is not open source ?

    That is one reason.

    Open source doesn't just mean that source code is available for free. It it also available without undue restrictions on what you can do with it.

    (And if you want the full source code for Oracle JDK, then it is not available for free, and the terms and conditions are pretty restrictive.)


    By contrast the OpenJDK codebase is covered by GPLv2 (with the "Classpath exception" which clarifies the point that an application built to use the OpenJDK JVM / class libraries is not subject to the GPL.) Everything that is part of OpenJDK is available as source code ... without you signing anything.

    Sure the GPL places restrictions on what you can do, but those are designed to make the code free (as in liberty) and protect the rights of the end-user.