How to Install Java JRE on Windows, macOS, and Linux
Java Runtime Environment (JRE) provides the libraries and components required to run Java applications. This guide shows step-by-step instructions for installing the JRE on Windows, macOS, and common Linux distributions, plus verification and basic troubleshooting.
Before you begin
- Decide whether you need the JRE specifically or the full JDK (Java Development Kit). The JDK includes the JRE plus development tools; many applications now require or bundle a JDK.
- Choose a Java distribution and version. Common options include Oracle JRE/JDK, Eclipse Temurin (Adoptium), Amazon Corretto, Azul Zulu, and Liberica. Use an LTS (long-term support) version like Java 17 or Java 11 unless an application requires another version.
- Check system architecture (64-bit vs 32-bit) and OS version.
1. Install on Windows
Option A — Install from an OpenJDK build (recommended)
- Download:
- Visit the vendor site (e.g., Temurin, Corretto, Azul) and download the Windows x64 installer for the desired Java version.
- Run installer:
- Double-click the downloaded .msi or .exe and follow prompts. Accept defaults unless you need a custom path.
- Set PATH (optional but useful):
- Open Start → Settings → System → About → Advanced system settings → Environment Variables.
- Under System variables, edit Path and add the JRE/JDK bin folder (e.g., C:\Program Files\Eclipse Adoptium\jdk-17\bin).
- Verify:
- Open Command Prompt and run:
java -versionYou should see the installed Java version.
- Open Command Prompt and run:
Option B — Oracle Java (if required)
- Oracle often requires an Oracle account and has license terms; download the Windows installer from oracle.com/java.
- Follow the installer and verify with java -version.
2. Install on macOS
Option A — Install via package from vendor
- Download:
- Get the macOS .pkg (or .dmg) for the chosen distribution and version (x64 or aarch64 for Apple Silicon).
- Install:
- Open the .pkg and follow the installer prompts. For .dmg, copy the .jdk or .pkg to Applications and run.
- Verify:
- Open Terminal and run:
java
- Open Terminal and run:
Option B — Install with Homebrew (recommended for convenience)
- Install Homebrew if you don’t have it:
/bin/bash -c ”$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)” - Install a Java distribution, e.g. Temurin 17:
brew install –cask temurin - Verify:
java -version
Notes:
- On Apple Silicon, prefer aarch64 builds (arm64) or use Rosetta for x64 versions.
- macOS may prompt to allow the app in Security & Privacy if installer is from an unidentified developer.
3. Install on Linux
General steps vary by distribution. Below are packages for common distros.
Debian / Ubuntu (APT)
- Update packages:
sudo apt update - Install Temurin JRE (example) or default-jre:
sudo apt install default-jreOr to install a specific vendor/package:
sudo apt install temurin-17-jre - Verify:
java -version
Fedora / CentOS / RHEL (DNF/YUM)
- Update:
sudo dnf update - Install default JRE or a vendor package:
sudo dnf install java-17-openjdk - Verify:
java -version
Arch Linux
- Use pacman:
sudo pacman -Syu jre-openjdk - Verify:
java -version
Manual tarball install (any distro)
- Download the tar.gz from vendor.
- Extract to /opt:
sudo tar -xzf openjdk-17_linux-x64bin.tar.gz -C /opt/ - Create symlink or update alternatives:
sudo update-alternatives –install /usr/bin/java java /opt/jdk-17/bin/java 1sudo update-alternatives –config java - Verify:
java -version
4. Verify installation and troubleshoot
- &]:pl-6” data-streamdown=“unordered-list”>
- java -version should show version and vendor.
- If command not found: ensure bin folder is in PATH or alternatives are configured.
- On Windows, check PATH and JAVA_HOME environment variables (some apps need JAVAHOME set).
- macOS Gatekeeper: allow installer under System Settings → Privacy & Security.
- Permission issues on Linux: use sudo for system-wide installs.
- Conflicting versions: use update-alternatives (Linux) or manage PATH to prioritize desired java.
5. Security and updates
- &]:pl-6” data-streamdown=“unordered-list”>
- Keep Java updated; use vendor packages or package manager to receive updates.
- Avoid installing older unsupported versions unless an application requires them; isolate legacy installs.
Leave a Reply