Java installation is a straightforward download-and-run process that takes about five minutes
Java is a program that runs on your computer and lets other software work properly. Many applications need Java to function — some network tools, certain security software, and older web-based programs all depend on it. Installing Java means downloading it from Oracle (the company that maintains it) and running the installer file, which handles the rest automatically.
You likely need Java if a program on your computer won't start and shows an error message mentioning Java, or if a network diagnostic tool you're trying to use requires it. Before you install, check whether you already have it — many computers come with Java pre-installed, and some software bundles include their own copy.
Key Takeaways
- Download Java from oracle.com/java/technologies/downloads, not from a search result or third-party site, to avoid malware.
- Choose the version that matches your operating system: Windows, macOS, or Linux, and whether your system is 64-bit or 32-bit.
- Run the installer file after downloading and follow the on-screen prompts — you do not need to change any default settings.
- After installation, restart your computer and then restart the program that needs Java to work.
Check if Java is already installed
Open the Command Prompt (Windows) or Terminal (macOS and Linux) and type java -version, then press Enter. If Java is installed, you'll see a version number. If you see "command not found" or a similar message, Java is not installed and you need to add it.
If Java is installed but the program you're trying to use still won't work, the installed version may be too old. Note the version number you see — Java versions are numbered 8, 11, 17, 21, and so on. If your program requires a newer version, you can install a second copy alongside the old one without removing the first.
Download Java from the official source
Go to oracle.com/java/technologies/downloads in your web browser. This is the official Oracle website where Java is distributed. Do not download Java from search results, software download sites, or links in emails — malware distributors often create fake Java installers that look legitimate.
On the Oracle page, you'll see a large blue button labeled "Download" next to "Java SE 21" or the current latest version. Click it. The page will then ask you to choose your operating system: Windows, macOS, or Linux. Select the one your computer uses.
Next, you'll see options for 64-bit and 32-bit versions. Most modern computers use 64-bit. If you're unsure, choose 64-bit — it works on nearly all computers made in the last ten years. The download will start automatically, and the file will appear in your Downloads folder with a name like jdk-21_windows-x64_bin.exe (Windows) or jdk-21_macos-x64_bin.dmg (macOS).
Run the installer and complete setup
Windows: Open your Downloads folder, find the .exe file, and double-click it. A window will appear asking if you want to allow the installer to make changes to your computer — click "Yes". The installer will then guide you through setup with a series of screens. You can accept all the default choices by clicking "Next" each time. When you reach the final screen, click "Close".
macOS: Open your Downloads folder, find the .dmg file, and double-click it. A window will open showing a Java icon and an Applications folder. Drag the Java icon into the Applications folder. When the copy finishes, close the window and eject the disk image by clicking the eject icon next to it in Finder.
Linux: Open a terminal in the folder where you downloaded the file. Type chmod +x jdk-21_linux-x64_bin.sh (replace the filename with the one you downloaded), press Enter, then type ./jdk-21_linux-x64_bin.sh and press Enter again. Follow the on-screen prompts and accept the license agreement by typing "yes".
Restart your computer and the program that needs Java
After the installer finishes, restart your computer. This ensures Java is fully integrated into your system and any programs looking for it can find it. After restart, open the program that requires Java — it should now work without errors.
If the program still shows a Java error after restart, the program may need a specific Java version. Check the program's documentation or help section for the Java version it requires, and return to oracle.com to download that version instead. You can have multiple Java versions installed at once without conflict.
Uninstall Java if you no longer need it
Windows: Open Settings, go to Apps, find "Java" in the list, click it, and select "Uninstall". Follow the prompts to remove it.
macOS: Open Finder, go to Applications, find the Java folder, and drag it to the Trash. Empty the Trash to complete removal.
Linux: Open a terminal and type sudo apt remove openjdk-21-jdk (or the version number you installed), then press Enter and type your password when prompted.
Frequently Asked Questions
Is Java the same as JavaScript?
No. Java and JavaScript are completely different programs with similar names. JavaScript runs in web browsers and is built into every browser automatically. Java is a separate program you install on your computer. A website that needs JavaScript will work without Java installed.
Why do I see a Java update notification?
Java periodically releases security updates. When you see a notification, it means a newer version is available. You can update through the notification, or download the latest version from oracle.com and run the installer — it will replace the old version automatically.
Can I have multiple versions of Java installed at the same time?
Yes. If one program needs Java 11 and another needs Java 21, you can install both. Each version operates independently. The program will use whichever version it was designed for.
What if the installer says Java is already installed?
This means Java is already on your computer. You can close the installer and use the existing installation. If you want a newer version, you can run the installer for that version — it will update to the new one automatically.
Do I need to restart after installing Java?
Yes. Restarting ensures Java is fully loaded into your system memory and that any programs looking for it can find it. Without restart, some programs may still report that Java is missing even though it was just installed.