Java Install and Setup

To write Java programs you must install a JDK (Java Development Kit). There are many free builds of the same OpenJDK, from Eclipse Temurin, Oracle, Amazon Corretto, Microsoft and others. They all work the same for learning.

Which version to install?

Install the newest LTS (long term support) version. At the time of writing it is Java 25. LTS versions get updates for many years, so they are the best for learning and for real projects.

Install steps

Windows

  1. Download the JDK installer (.msi) of Java 25 from adoptium.net (Eclipse Temurin) or oracle.com/java.
  2. Run the installer. Choose the option to set the JAVA_HOME variable and to add Java to the PATH.
  3. Open a new Command Prompt and check the install.

macOS

  1. Download the .pkg file from adoptium.net and run it, or use Homebrew.
  2. Check the install in the Terminal.
brew install --cask temurin@25

Linux

# Ubuntu or Debian (the package name can change with the version)
sudo apt update
sudo apt install openjdk-25-jdk

Check the install

Two commands must work: java (the runtime) and javac (the compiler).

Terminal

$ java -version
openjdk version "25.0.5" 2026-10-20 LTS
OpenJDK Runtime Environment Temurin-25.0.5+8 (build 25.0.5+8-LTS)
OpenJDK 64-Bit Server VM Temurin-25.0.5+8 (build 25.0.5+8-LTS, mixed mode, sharing)
$ javac -version
javac 25.0.5

If you see “command not found” the JDK is not in your PATH. Close the terminal, open a new one and try again, or check the JAVA_HOME and PATH settings.

Code editor or IDE

ToolGood for
IntelliJ IDEA (Community)The most used Java IDE, with great hints
EclipseFree IDE, also very popular
VS Code with the Java extensionLight editor for beginners
Notepad or any text editorFine for the first small programs, with the terminal
Note: You do not need a big IDE on the first day. A text editor and the terminal are enough for the first chapters, and you will understand better what the tools do. Next: Your First Java Program.

Congratulations! Chapter Finished. Learn more about the similar topics:
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.