Helping millions of people navigate the world of technology.

How to Fix “Unable to Locate Java Runtime” Error

Key Takeaways 
  • This problem could indicate that you have not correctly installed Java on the computer.
  • In some cases, you will have to allow Java through the firewall.

Basic Fixes: 

  • Uninstall conflicting Java versions: If conflicts are causing the problem, you can resolve them by completely removing older Java versions and leaving only the most recent one.
  • Verify environment variables: If the application cannot find the necessary Java installation to execute Java-based programs, confirm Java is on the right path.

Fix 1: Install or Re-Install Java Properly

If you’ve not installed Java or have installed it incorrectly, all applications that rely on it will return the error message: Java Runtime Environment not found. Before you advance to the solutions below, you should check the status of Java on the computer. Here’s how.

Step 1: Click the magnifying lens on the Taskbar, type Command Prompt, and click the Run as Administrator option.

Open Command Prompt 6

Step 2: Type the command below and hit Enter to check your Java status.

java -version
Check Java version

Step 3: Running the command will display the version of Java on your computer if installed correctly. If not, you may receive an error message.

Tip: You may follow these steps if you can not open the Windows 11 Command Prompt.

Fix 2: Repair or Reinstall the Java Dependent Application

You should also investigate the possibility of a corrupt Java-dependent application. Some programs come with a repair option. While the repair steps may vary by program, generally, most apps follow the process outlined below.

Step 1: Open the search window on the Taskbar, type control, and click the Uninstall a program option.

Uninstall a program 1

Step 2: Select the app under the Name column, then click any of these available options: Change, Uninstall/Change.

Change app

Step 3: Click the Repair button and follow any instructions to complete the process.

Repair application

Alternatively, if repairing the dependent application does not work, you should consider reinstalling the application. Before reinstalling it, however, you must completely uninstall the application and ensure you reinstall from a freshly downloaded copy.

This way, you are guaranteed that any corruption that affected the older installation will not affect the new one.

Fix 3: Download and Install the Java Runtime Environment

After you run the Java -version command, if you discover Java is not present on your computer, you must download and install it. This will require visiting the official Java website. The steps below will walk you through the process.

Step 1: Visit the official website and click the green Download button.

Download Java

Step 3: Double-click the downloaded file to start the installation.

Step 4: Click the Install button.

Start Java Install 1

Step 5: Close the installer and verify the problem is fixed.

Fix 4: Allow Java Through Your Firewall

The Windows 11 firewall helps protect your computer by blocking threats, unwanted programs, and other malicious software. Some programs may ask for permission to pass through the firewall. If the firewall blocks Java, you will get the Java Runtime Environment is not found error. Here’s how you can fix the same.

Step 1: Click the magnifying lens on the Taskbar, type allow, and click Allow an app through Windows Firewall.

Open firewall

Step 2: Click the Change Settings button and Allow another app.

Open Java location

Step 3: Click Browse, navigate the path below, and add your Java installation.

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Java
Browse java

Step 4: Click the OK button.

Was this helpful?

Thanks for your feedback!

Last updated on 21 August, 2024

Leave a Reply

Your email address will not be published. Required fields are marked *

The article above may contain affiliate links which help support Guiding Tech. The content remains unbiased and authentic and will never affect our editorial integrity.