Installing Java (JDK, JRE, JVM)
Installing Java (JDK, JRE, JVM)
Section titled “Installing Java (JDK, JRE, JVM)”Before you can develop and run Java applications, you need to install the appropriate Java environment.
JVM – Java Virtual Machine
Section titled “JVM – Java Virtual Machine”The JVM is the engine that executes Java bytecode. It is platform‑specific and provides the runtime environment.
JRE – Java Runtime Environment
Section titled “JRE – Java Runtime Environment”The JRE includes the JVM plus core libraries and other components needed to run existing Java programs. It does not include development tools like the compiler.
JDK – Java Development Kit
Section titled “JDK – Java Development Kit”The JDK contains the JRE plus development tools such as:
javac– the Java compiler (source → bytecode)jar– archiverjavadoc– documentation generatorjdb– debugger
How to install
Section titled “How to install”- Choose a JDK distribution – Oracle JDK, OpenJDK, Adoptium, Amazon Corretto, etc.
- Download the installer for your operating system from the official site (e.g., adoptium.net).
- Run the installer and follow the instructions.
- Set environment variables (optional, but recommended):
JAVA_HOME– path to the JDK installation directory.- Add
%JAVA_HOME%\bin(Windows) or$JAVA_HOME/bin(macOS/Linux) to yourPATH.
Verify installation
Section titled “Verify installation”Open a terminal/command prompt and run:
java -versionjavac -versionYou should see version information confirming that both java (the launcher) and javac (the compiler) are available.