Install the JDK

To write Java you install the JDK (Java Development Kit) β€” the compiler (javac), the runtime (JVM), and developer tools.

Get an LTS build

  • Download an LTS release (Java 21 or 25) from Eclipse Temurin (adoptium.net) β€” free and widely used.
  • Oracle, Amazon Corretto, and Azul Zulu are other solid distributions.
  • Install it, then verify from a terminal.
java -version     # runtime
javac -version    # compiler

You should see the version you installed. If not, the PATH isn't set (see below).

PATH & JAVA_HOME

Tools like Maven expect JAVA_HOME to point at your JDK, and java/javac to be on your PATH.

bash
# macOS/Linux (add to ~/.zshrc or ~/.bashrc)
export JAVA_HOME=/path/to/jdk
export PATH="$JAVA_HOME/bin:$PATH"
Tip: On Windows, if java -version isn't recognised, add the JDK's bin folder to the PATH environment variable and reopen the terminal.

Managing multiple versions

If you juggle projects on different Java versions, a version manager like SDKMAN! (macOS/Linux) makes switching trivial.

sdk install java 21-tem
sdk use java 21-tem

An IDE

Most developers use IntelliJ IDEA (Community edition is free) or VS Code with the Java extensions β€” you get autocomplete, refactoring, and one-click run/debug.

Note: You can start with just a text editor and the terminal, but an IDE dramatically speeds up real Java work.
Free preview. Sign in and subscribe to unlock all 809 lessons across 25 courses.
Install the JDK β€” Java | Full Stack Learning Simplified