If the JDK contains both the JRE and JVM does that mean we can find the source code for all of these in, for example, an OpenJDK repository?
-
2Yes. See [Where to find Java JDK Source Code?](https://stackoverflow.com/questions/2896727/where-to-find-java-jdk-source-code) – Botje May 06 '20 at 11:59
-
1Not necessarily. The JVM can as well be contained as compiled binary result. But OpenJDK is indeed open-source, you can find it on their official GitHub repo https://github.com/openjdk. – Zabuzard May 06 '20 at 12:00
-
2@Botje frankly all those answers are woefully outdated. – Federico klez Culloca May 06 '20 at 12:00
-
Yes, the source code for both is in OpenJDK. – President James K. Polk May 06 '20 at 12:01
-
@FedericoklezCulloca fair enough. I usually just browse http://hg.openjdk.java.net/ (or a local clone of it) – Botje May 06 '20 at 12:06
-
The fact a JDK contains JRE and JVM in no way implies that you will be able to find the source code for all of them. This would depend on the specific JDK and its vendor. – Mark Rotteveel May 06 '20 at 15:39
1 Answers
Today, yes.
Currently, every implementation of Java available is built entirely or partially on the source code provided by the OpenJDK project.
Understand that the Java platform is defined by a set of specifications, JSRs, and JEPs. Any implementation that complies with these specs will run your Java app. Any one is free to write such an implementation. But using the trademark Java requires coming to terms with the trademark owner, Oracle.
In the past, some vendors built their own implementations from their own proprietary codebase. Some of those were closed-source.
Today, all the vendors have agreed to work cooperatively through the OpenJDK project. These vendors retain the right to add features or write patches to fix bugs and security vulnerabilities, provided they abide by the licensing terms required by the OpenJDK project.
Most/all of the vendors also cooperate to provide executable builds & installers through the AdoptOpenJDK project.
Here is a flowchart I made listing the various vendors and their Java implementations.

- 303,325
- 100
- 852
- 1,154