

You have to make sure that JAVA_HOME is set correctly, with version details. The line defining JAVA_HOME in the output is as follows: export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-17.0.4.1.1–1.fc35.x86_64 For instance, you can execute this command in the terminal: $ more ~/.bashrc bashrc file to see whether it defines JAVA_HOME and what value is assigned to the environment variable. The file itself contains a series of commands to configure the terminal session.Ĭheck your. bashrc file is a script that runs when a user logs in. bashrc: this dot means that the file doesn't normally turn up when you display the contents of the directory. bashrc if you use the Bash shell that is the default on Linux. This file is located in your home directory and is called. When you upgrade Java, the system installs a new JDK, and you need to update JAVA_HOME to point to the new location.Įnvironment variables used in the shell are generally defined in a start-up file. You can learn more about the Java platform components in the article, What is the Java Runtime Environment. When non-developers run Java, they don't need the entire JDK, so they can download a JRE and point JAVA_HOME to that. As the error message shown earlier indicates, you should point to your JDK if you have a JDK. Your shell finds the proper Java environment through an environment variable called JAVA_HOME.

#Should i update java runtime environment how to
This article shows you how to fix this problem.

The source of the problem is probably the setting of your JAVA_HOME environment variable. NB: JAVA_HOME should point to a JDK not a JRE This environment variable is needed to run this program The JAVA_HOME environment variable is not defined correctly
#Should i update java runtime environment install
When you try to run a Java program after updating your system's version of Java, you are likely to receive an error message such as the following: mvn install
