[Solved] Error: Could not find Java SE Runtime Environment

In this post, I will be sharing how to fix error: could not find java se runtime environment. This error may occur if you are trying to run a simple java -version command or when you try to open a .jar file using the "java -jar xxx.jar" command in the command window. You will face the following message:

Read Also: Bad operand types for binary operator in java


Error: Registry key ‘Software\JavaSoft\JRE’
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.

[Fixed] Error: could not find java se runtime environment



1. Go to "Programs and Features" and uninstall all the previous java versions. Check the location "C:/Program Files/..." and delete all the java folders inside it.

2. Also, clean up your registry (delete the java key present inside it).

3. Go to Start and then click on the Run.

4. Type "regedit"

5. Go to the path "HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/Uninstall" . Uninstall folder will contain many registry entries within curly brackets as shown below.
regedit path



6. Now, click on the Edit tab and then Find (Note: Highlight Uninstall folder before searching for the particular registry.)

7. Enter version string as value to find corresponding registry entry to be deleted.

Steps for finding registry keys


a. Any version of Java 7


Follow format 7.0.xxx
where xxx can be 100, 120, 130, 140, and so on

Please refer to below examples:
Type 7.0.100 in the search field, it will find registry key for Java7 update 10
Type 7.0.120 in the search field, it will find registry key for Java7 update 12
Type 7.0.180 in the search field, it will find registry key for Java7 update 18


b. Any version of Java 6


Follow format 6.0.xxx
where xxx can be 100, 120, 130, 140, and so on

Please refer to below examples:
Type 6.0.100 in the search field, it will find registry key for Java6 update 10
Type 6.0.120 in the search field, it will find registry key for Java6 update 12
Type 6.0.180 in the search field, it will find registry key for Java6 update 18


c. Any version of Java 5


Follow format 1.5.0.xxx
where xxx can be 100, 120, 130, 140, and so on

Please refer to below examples:
Type 1.5.0.100 in the search field, it will find registry key for jre1.5.0_01
Type 1.5.0.120 in the search field, it will find registry key for jre1.5.0_12
Type 1.5.0.180 in the search field, it will find registry key for jre1.5.0_18



8. Once you find the registry key, highlight that key and then Right-click on it and choose Delete.

9. Confirm the Delete and click Yes.


After following the above steps, now, reinstall Java and set System variable JAVA_HOME in your machine to your JRE(or JDK) path.

Please find the example below:

JAVA_HOME- C:\Program Files\Java\jdk1.7.0_80

Path- C:\Program Files\Java\jdk1.7.0_80\bin


How to Check Error is Resolved


You can check if the above solution is correct by executing the following commands in the command window.

1. By printing JAVA_HOME in the command window.

echo %JAVA_HOME%

2. Checking the version of Java in the command window.

java -version 


That's all for today, please mention in the comments in case you know any other way to solve the error: could not find java se runtime environment.

Reference:
Oracle docs

About The Author

Subham Mittal has worked in Oracle for 3 years.
Enjoyed this post? Never miss out on future posts by subscribing JavaHungry