To start developing in Java you need to install the JDK — the Java Development Kit. It includes the javac compiler, the JVM, the standard library, and various utilities. Several JDK distributions are available — they all implement the same OpenJDK standard but differ in licensing and support.
Installing the JDK
Select your operating system — the instructions differ by platform.
Configuring JAVA_HOME
Many build tools and IDEs use the JAVA_HOME environment variable to locate the JDK. Without it Maven, Gradle and others may fail to start.
Verifying the Installation
After installation open a new terminal and run through these verification steps:
bash
java -version
# openjdk version "25.0.x" ...
# OpenJDK Runtime Environment Temurin-25...
javac -version
# javac 25.0.x
which java # Linux/macOS
where java # WindowsManaging Multiple JDK Versions
Real-world projects often require switching between Java versions. Dedicated version managers exist for this purpose.
bash
# SDKMAN! — usage examples
sdk install java 25-tem # install Temurin 25
sdk install java 21-tem # install Temurin 21
sdk use java 21-tem # switch for current session
sdk default java 25-tem # set global default
sdk current java # show active version