Java Hungry
Java developers tutorials and coding.
[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:
[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.
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.
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.
2. Checking the version of Java in the command window.
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.
How to Fix «Java Runtime Environment not found» error
In this post, we will solve the «Java Runtime Environment not found error». This java error is one of the common errors faced by developers or end-users. Whenever you try to install any software which requires java like eclipse or Minecraft. Also, if you are new to java development, JDK or Java Development Kit is necessary for you.
Following this tutorial will help you to resolve all Java runtime errors. Additionally, you will learn to install, remove and set java variables in Windows10 and Ubuntu.
These are the very common errors you will find related to Java.
- java runtime environment not found
- java runtime environment not found windows 10
- eclipse java runtime environment not found
- eclipse java runtime environment not found path
- java SE runtime environment not found
- java runtime environment not found at bin javaw.exe
- unable to load java runtime environment
- cannot determine a valid java home
- java runtime environment not found mac
Let’s understand some basic concepts of Java runtime first. Check out this post, if you are getting a java command not found error.
What is a runtime environment?
Runtime basically means everything you require to run a program. Which includes environment variables, directory structure, common libraries etc. This can also be a virtual machine like
- JRE (Java Runtime Environment)
- CLR (Common Language Runtime) for .net framework
The target would be JRE or CLR for your program, need to decide by you. As soon as you execute any program, it’s in run time.
JRE vs JDK
JRE | JDK |
---|---|
Stands for Java Runtime Environment | Stands for Java development kit |
To run Java programs, you need JRE | Helps to build Java programs and applets |
Platform dependent contains libraries and supporting tool | Platform dependent contains tools development and debugging |
JRE does not contain a development kit. | JDK includes JRE also to execute the program |
Simple JRE VS JDK
What are the causes of the «Java Runtime environment not found» error
- Java is not installed in your system
- Java installation not completed (due to errors)
- Environment variables of Java are not set
- Java conflict due to more than one Java Runtime installation
Because JRE is platform-dependent, I have covered java installation, variable setup and un-installation for Windows and Ubuntu both.
Choose Windows 10 or Ubuntu 20.04 from the post and follow step by step to get java issues resolved.
Java download
Before installation, first, we need to download java —
Step1
Visit oracle.com and download JDK 15 or the latest available for your system. I am downloading it for Windows 10 (64-bit). The latest available versions of java are listed in the screenshot.
How to install Java runtime environment step by step
Let’s solve 1 st reason for «Java runtime environment not found», Because java is not installed.
Step2
First, check for any pre-installed java version —
Open the command prompt with «Run as administrator» and run java command.
How to install java runtime environment in Windows 10
Step3
Once Download completes. Browse to the «jdk-15.0.1_windows-x64_bin.exe» file and double-click on it, to run the installer. Click Next.
Step4
I recommend keeping «C:\Program files\java\jdk-15.0.1 (64-bit)» as the default installation folder. Select Next.
You may select different installation folders also. For example, if you are installing a second instance of java software. Click on change and browse for the target folder.
Step5
Let installation complete, it may take a few minutes.
Step6
Click close. Now you are done with java installation on windows 10.
How to set the environment variable for java in windows10
Set the Environment variable for java in windows 10 by these steps —
Step7
Type «environment» in the search window. Click «open» on «Edit the system environment variables«
Step8
Click on Environment variables.
Step9
Select «Path» > Then click Edit.
Step10
Select New > Give path of java installation directory > For example, «C:\Program files\java\jdk-15.0.1\bin» in my case. If you have selected a different folder for java installation in step4. You can enter your path to the bin folder.
Click OK.
Step11
Set «classpath» for java. Click «New» in the environment variable window. It allows to set up the new environment variables.
Step12
In «Variable name», enter «classpath«. Also in «variable value» provide path to your java installation till «lib» folder. In my case it is «C:\program files\java\jdk-15.0\lib > Select OK
Close all open environment variables windows by selecting OK.
How to check what version of java I have?
Installation and java variables have been set up. Now, Let’s validate the java installation and version.
Step13
Open the command prompt with «run as administrator» rights in windows 10.
Step14
Run the «java» command to check your Java and JRE (Java Runtime Environment) version.
Check java SDK version with javac command
Video tutorial-JRE error solved for Windows
«Java Runtime Environment not found» error fixed for windows 10
How to uninstall java from Windows 10
In case, you are not happy with your old java or JRE version and want to install a new. For that, you need to remove the old Java version.
Cleanup of Java from Windows 10 is pretty easy. Follow these steps to remove java from your system.
Step15
Search add or remove programs and click open
Step16
Select the java program and click Uninstall.
Java software will go from the window. You can clean up java variables also, set up in step10 and 11 earlier.
How to install java runtime environment in Ubuntu 20.04
There are two ways to download and install java or JDK in Ubuntu 20.04
A.) Using the apt command
B.) Download the Oracle JDK package and install it manually
Let’s see both options one by one-
A.) How to install java or JRE in Ubuntu 20.04 using the apt command
To install Java in Ubuntu using the repository, Follow these commands
Step17
Update package index using apt command
Step18
Check if you have any old java versions installed in the system. In my case, java is not installed.
output
Command ‘java’ not found, but can be installed with:
sudo apt install openjdk-11-jre-headless # version 11.0.9.1+1-0ubuntu1
Step19
Run the «apt» command to install java or JRE. I will install default-jre version 2:1.11-72 in my Ubuntu system from the list.
Select «Y» and press Enter. Let installation complete. it will take a few minutes.
Step20
Check the java version
output
How to Remove java from Ubuntu 20.04
Step21
Run apt command to remove JRE package installed. Press Y and then enter.
B.) How to install the latest java or JDK in Ubuntu 20.04 from oracle (manually)
Step22
Java JRE download steps —
Visit oracle.com and download JDK 15 or the latest available .deb and transfer to your system. I am downloading Debian package jdk-15.0.1_linux-x64_bin.deb.
Alternatively, you can download java using wget command.
Reference output
Step23
Rename the .deb file using mv command, if required. Then install the Debian package using the dpkg command.
output
Default installation directory path of java would be «/usr/lib/jvm/jdk-15.0.1/«. So, make a note of it, as it will be required to set up a Java_HOME variable.
How to set the «JAVA_HOME» variable in Ubuntu 20.04
Set the JAVA_HOME variable for all users in Ubuntu by editing the environment file.
Step24
Edit /system/environment file
Add path «/usr/lib/jvm/jdk-15.0.1/bin» to the last of the environment file. Then, save and exit.
Run source command to execute changes made in the environment file.
Step25
Check your java version
Remove java runtime environment package using dpkg command
Step26
Run the dpkg command with the —purge option to completely clean java from Ubuntu 20.04
Video Tutorial — JRE error solved for Ubuntu
Video on «How to fix java runtime environment error in Ubuntu 20.04»