JCP and Java APIs: Who Defines the Building Blocks of Java Development?
Here are a few notable Java SDK implementations:
- Oracle JDK (Java Development Kit): This is the official reference implementation provided by Oracle. It includes the Java SE platform, tools for Java development, and the Java Runtime Environment (JRE). Oracle JDK has both free and commercial versions.
- OpenJDK (Open Java Development Kit): OpenJDK is the open-source reference implementation of the Java Platform, Standard Edition (Java SE). It is the basis for Oracle JDK, and many other JDKs are derived from or compatible with OpenJDK.
- AdoptOpenJDK: This is a community-driven distribution of OpenJDK with prebuilt binaries available for various operating systems. It’s known for providing long-term support and timely updates.
- Amazon Corretto: Amazon Corretto is a no-cost, multiplatform, production-ready distribution of the OpenJDK. It is designed to be compatible with Java SE and is intended for use in production environments.
- IBM SDK, Java Technology Edition: IBM provides its own implementation of the Java Development Kit, which includes the Java Runtime Environment (JRE) and tools for developing Java applications. It is available for various platforms.
- Azul Zulu OpenJDK: Azul Systems offers Zulu, a certified build of OpenJDK. Zulu is available for a variety of platforms and includes different distributions, such as Zulu Community and Zulu Enterprise.
So who defines these packages like java.util, java.net and classes inside them like String, HTTP Connection and methods inside classes…ultimately oracle and opensdk needs to implement them…but who defines apis
The APIs (Application Programming Interfaces) in Java, including packages, classes, and methods, are defined through the Java Community Process (JCP). The JCP is a collaborative effort that involves contributions from various organizations, individual developers, and the wider Java community. The JCP defines the standards for the Java Platform, Standard Edition (Java SE), Java Platform, Enterprise Edition (Java EE), and other Java specifications.
The process for defining and evolving Java specifications through the JCP involves the following key steps:
- Specification Request (JSR): A Specification Request is proposed to address a specific need or to introduce new features. JSRs define the scope, requirements, and goals for a particular Java specification.
- Expert Group: An Expert Group is formed to work on the development of the specification. This group consists of individuals, organizations, and other stakeholders with expertise in the relevant area. They collaborate to draft the specification and reference implementation.
- Public Review: The draft specification is made available for public review and feedback. This allows the broader Java community to provide input and identify potential issues.
- Maintenance and Updates: After the specification is finalized, it can go through maintenance and updates to address issues, add new features, or improve existing ones.
The APIs defined in the specifications become part of the Java Standard Edition or other editions, depending on the nature of the specification. Once the specifications are finalized, they are implemented by various Java runtime providers, including Oracle JDK, OpenJDK, and others.
converting java code to bytecode…that also each vendor writes for itself?
Yes, the process of converting Java source code to bytecode is standardized and follows the Java Language Specification (JLS). The responsibility for this conversion lies with the Java Compiler, which is part of the Java Development Kit (JDK) provided by various vendors.
vendors write APIs, write code to convert to bytecode…now do they also write jvm to convert bytecode to machine code
Yes, that’s correct. Java vendors are responsible for providing a Java Virtual Machine (JVM) implementation that executes Java bytecode on a specific hardware platform. The JVM is a crucial component of the Java runtime environment and is responsible for interpreting or compiling Java bytecode into machine code that can be executed by the underlying hardware.
Finally who runs the machine instructions ?
The native machine code generated by the JVM is executed directly by the Central Processing Unit (CPU) of the underlying hardware.
i understood sdk which basically is implmentations of apis…i uderstood jvm which basically converts bytecode to machine code…now what is jre
- JRE = JVM + Java Libraries: The Java Runtime Environment (JRE) consists of the Java Virtual Machine (JVM) along with the Java class libraries and supporting files. The JVM is responsible for interpreting or compiling Java bytecode, and the Java libraries provide pre-built classes and packages that developers can use to perform various tasks in their Java applications.
- JVM (Java Virtual Machine): The JVM is the runtime engine that executes Java bytecode. It interprets or compiles the bytecode into native machine code, allowing Java applications to run on different platforms without modification.
- Java Libraries: The Java class libraries include a wide range of classes and packages that provide ready-made solutions for common programming tasks. These libraries are written in Java and are distributed as bytecode. When a Java application is executed, the JVM loads and uses the bytecode versions of these classes.