What Java is and why you need it

Java is software that lets programs run on your computer. Many applications — from banking software to games to work tools — need Java installed before they will start. If a program tells you "Java not found" or "Java Runtime Environment required," you need to download it.

Java comes in two versions. The one most people need is called the Java Runtime Environment (JRE), which lets you run programs that were built in Java. If you are writing Java code yourself, you would need the Java Development Kit (JDK) instead. This guide covers the JRE, which is what you download when a program asks for Java.

Java is free and comes from Oracle, the company that owns it. You download it directly from Oracle's website — there is no payment and no trick. Once installed, it runs quietly in the background.

Key Takeaways

  • Download Java from oracle.com/java/technologies/downloads, not from a search result ad or a third-party site.
  • Choose the version that matches your computer: Windows, Mac, or Linux, and whether your system is 64-bit or 32-bit.
  • Run the installer file after download and follow the on-screen prompts — the default settings work for most people.
  • After installation, restart any program that was asking for Java, and it should now run without the Java error.
  • If you are unsure whether your computer is 64-bit or 32-bit, Windows and Mac both have built-in ways to check before you download.

Check whether your computer is 64-bit or 32-bit

Java comes in two versions based on your computer's architecture. Almost all modern computers are 64-bit, but checking takes 30 seconds and prevents downloading the wrong file.

On Windows: Right-click the Start button and select "System." Look for the line that says "System type." It will say either "64-bit operating system" or "32-bit operating system." Write down which one you have.

On Mac: Click the Apple menu in the top-left corner and select "About This Mac." Look at the line that says "Processor." If it says "Apple Silicon" or "M1" or "M2," you need the ARM 64 version. If it says "Intel," you need the x64 version.

On Linux: Open a terminal and type uname -m. If it returns "x86_64," you need the x64 version. If it returns "aarch64," you need the ARM 64 version.

Download Java from Oracle's website

Go to oracle.com/java/technologies/downloads in your web browser. This is the official Oracle page. Do not use a search result that says "Download Java" — many ads and third-party sites bundle Java with unwanted software.

On the Oracle page, you will see a large button labeled "Download" under "Java SE 21" or the current version number. Click it. The page will show you several download options.

Find the row that matches your computer. If you are on Windows and checked that your system is 64-bit, click the link in the "Windows x64" row. If you are on Mac with an Intel processor, click "macOS x64." If you are on Mac with Apple Silicon (M1, M2, or newer), click "macOS ARM 64." Choose the file that ends in .exe (Windows), .dmg (Mac), or .deb (Linux). Click the link and the file will download to your computer.

The download is usually 100 to 200 megabytes and takes a few minutes on a normal internet connection. Your browser will show a progress bar or ask you where to save the file. Let it save to your Downloads folder — you will find it easily there.

Install Java on Windows

Open your Downloads folder. Find the file you just downloaded — it will be named something like "jdk-21_windows-x64_bin.exe." Double-click it to start the installer.

A window will appear asking "Do you want to allow this app to make changes to your device?" Click "Yes." The Java Setup window will open. Click "Next" to begin.

The installer will ask where you want to install Java. The default location (usually "C:\Program Files\Java") works for almost everyone. Click "Next" again. On the next screen, click "Next" once more to confirm the installation path.

The installer will now copy files to your computer. This takes one to two minutes. When it finishes, a screen will say "Java Setup — Complete." Click "Close." Java is now installed.

Install Java on Mac

Open your Downloads folder. Find the file you downloaded — it will be named something like "jdk-21_macos-x64_bin.dmg" or "jdk-21_macos-aarch64_bin.dmg." Double-click it.

A window will open showing a Java icon and an Applications folder. Drag the Java icon into the Applications folder. Your Mac will copy the Java files. This takes one to two minutes.

When the copy is done, close the window. Open Applications (you can find it in Finder or press Command+Shift+A). Look for a folder called "Java" or scroll down to find the Java installer. Double-click the Java installer icon inside. Your Mac may ask for your password — type it and click "Install Software."

When installation finishes, close the window. Java is now installed on your Mac.

Install Java on Linux

Open a terminal window. Navigate to your Downloads folder by typing cd Downloads and pressing Enter. Then type the command that matches your system:

For Debian or Ubuntu: Type sudo dpkg -i jdk-21_linux-x64_bin.deb (or the name of your downloaded file) and press Enter. Your system will ask for your password. Type it and press Enter. The installer will run and finish in one to two minutes.

For other Linux distributions: The .tar.gz file is more universal. Type tar -xzf jdk-21_linux-x64_bin.tar.gz and press Enter. Then type sudo mv jdk-21.0.1 /usr/local/java and press Enter. Type your password when asked.

When the command finishes, close the terminal. Java is now installed.

Verify that Java installed correctly

Open a terminal (on Mac or Linux) or Command Prompt (on Windows). On Windows, press the Windows key, type "cmd," and press Enter. On Mac, press Command+Space, type "terminal," and press Enter. On Linux, open your terminal application.

Type java -version and press Enter. If Java installed correctly, you will see a message showing the Java version number, like "java version 21.0.1" or similar. If you see an error message like "java is not recognized," Java did not install or your computer does not know where to find it. Go back and check that the installer finished without errors.

Close the terminal. You can now run any program that needs Java. If a program was already open and asking for Java, close it completely and open it again — it should now work.

Frequently Asked Questions

Do I need to pay for Java?

No. Java is free to download and use. If a website asks you to pay for Java or offers it as a paid download, that is not the real Java — use oracle.com instead.

What is the difference between JRE and JDK?

JRE (Java Runtime Environment) runs programs written in Java. JDK (Java Development Kit) is for people who write Java code. If a program is asking you to install Java, you need the JRE. Only download the JDK if you are learning to code in Java.

My computer says it is 32-bit but I cannot find a 32-bit download option anymore

Oracle stopped offering 32-bit Java downloads for newer versions. If your computer is genuinely 32-bit, you may need an older version of Java. Check the program that needs Java — it may tell you which version it requires. You can also contact the program's support team to ask whether they support 32-bit systems.

Do I need to uninstall the old version of Java before installing a new one?

No. The new installer will replace the old version automatically. You can also uninstall old versions afterward if you want to clean up, but it is not necessary.

Java installed but the program still says Java is not found

Close the program completely and open it again. If that does not work, restart your computer. Sometimes a program checks for Java when it starts, and it needs to be restarted to see the new installation. If it still does not work after a restart, the program may need a specific version of Java — check the program's documentation or contact its support team.