7

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 ?

2 Answers 2

11

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.

Sign up to request clarification or add additional context in comments.

10 Comments

when you say full source code for oracle jdk is not available .. But i see all source code available for Java api's. May be you mean source code may not be available for other JDK components like jconsole etc Is that right ?
That is correct. Also, the source code for the Oracle JVM itself is not included.
one more thing on Oracle JDK am i allowed to modify source code for my purpose and use it in my production if i do not redistribute the modified code to anyone else ?
@scottmiles the oracle JDK has a "You must accept this binary license" thing you must click before you can download it. I suggest you read that binary license very carefully.
The Oracle Binary license forbids that is you want to redistribute. Not sure about "internal use only". Either way, I recommend using OpenJDK if you intend to modify anything. But even then, you may find that the Oracle >>trademark<< restrictions apply; i.e. you can't called your modifications "Java".
|
1

OpenJDK is open source under the GPL v2 license, whereas OracleJDK uses Oracle Binary Code License Agreement (more on that here and here).

You're not wrong when you say that the source code is freely available but it's not allowed to be modified and redistributed further.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.