'Java jdk11 installation on Windows 10 problems

I had on my Windows 10 (Vmachine in Citrix) Java JRE 17 preinstalled.

By calling it in the command prompt with java --version, I got the response of the version that was installed.

Since I needed to install JDK 11 on my machine, I proceeded to the installation from Oracle and installed the JDK8 exe file and executed it. The installation was successful. So I had JRE17 and JDK11.

I have changed the environment variable (System Variables) that was set for JAVA_HOME from the path of JRE17, to my new destination path of JDK11.

I have changed the Path variable that was set for JRE17 to JDK11 as well.

Clicked OK and again OK on the System properties window to save the changes I made.

Reopened the command prompt. After then calling the prompt command with java --version, I got the response, that is not recognized as an internal or external command (my JDK11).

Now, after I tried to set back the environment variable of JAVA_HOME and the Path to JRE17, I again get the response that is not recognized as an internal or external command (my JRE17 that was working just before the change. I was taking good care, not to make a mistake while changing and setting the environment variables and even tried with resetting my machine in hope it would work afterwards.

So what I actually need later on, is Apache Maven 3.8.5. For that installation, I needed to make sure, JAVA_HOME is set to the location of my JDK, which was the reason why I was installing JDK11 (as instructed).

Could anyone assist me with this matter and give me some instructions on what am I doing wrong? I spent already 12 hours of installing, deinstalling, reinstalling, resetting paths and it seems that I am missing something.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source