Could Not Find Java SE Runtime Environment

Sheeraz Gul Jul 15, 2022
Could Not Find Java SE Runtime Environment

The Could not find Java SE Runtime Environment error can occur when there is Runtime Environment installed, i.e., Java cannot find the main java.dll file. This tutorial demonstrates how to solve the Could not find Java SE Runtime Environment error in Java.

Fix the Could not find Java SE Runtime Environment Error in Java

When we are trying to open a Java file through a command prompt, the Could not find Java SE Runtime Environment error can occur if it doesn’t find the Runtime Environment. The error that occurs is given below.

Java SE Runtime Error

The reason for this error can be:

  1. The registry is corrupted.
  2. The Java path is missing in the Environment Variables.
  3. Java installation folder is moved.
  4. The java.dll file is deleted or moved.

It is easy to fix this error; we must address the above reasons. All the reasons above can be solved by deleting and reinstalling the Java on your system.

Follow the steps below.

  • Delete all the previously installed versions of Java. It can be done through the Programs and Features uninstall option.
  • Clean the registry by deleting the Java key.
  • Open the Registry Editor Regedit from the Start menu. Write Regedit in run and start it.
  • Go to HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/Uninstall.
  • Right-click on the Uninstall and click Find.
  • Type your current Java version and find.
  • Once the key is found. Right-click on it and choose the delete option and confirm it.
  • Once the Java key is deleted, we can reinstall Java.

    Java Registry Key

  • Download the latest version of Java from here.
  • Set the Environment Variable correctly. After setting, you can check it by the command echo %JAVA_HOME%.
    JAVA_HOME - C:\Program Files\Java\jdk-17.0.2
    
    Path - C:\Program Files\Java\jdk-17.0.2\bin
    
  • Once the new version of Java is installed successfully and the Environment Variable is set, the Could not find Java SE Runtime Environment will be solved.
  • Check by running the command java -version.

    Java Version

All the reasons described above for the Could not find Java SE Runtime Environment error will be solved by following the process described in the steps.

Author: Sheeraz Gul
Sheeraz Gul avatar Sheeraz Gul avatar

Sheeraz is a Doctorate fellow in Computer Science at Northwestern Polytechnical University, Xian, China. He has 7 years of Software Development experience in AI, Web, Database, and Desktop technologies. He writes tutorials in Java, PHP, Python, GoLang, R, etc., to help beginners learn the field of Computer Science.

LinkedIn Facebook

Related Article - Java Error