Search code examples
javaechojava-home

"echo %JAVA_HOME%" returns wrong path even though System JAVA_HOME Environment variable set


As far as I can tell my System JAVA_HOME Variables are set correctly, but echo %JAVA_HOME% returns a wrong path (it is for an old version of Java) even after I restarted windows.

Here are my environment settings

Another program also thinks JAVA_HOME is set to this wrong path.

I'm using Windows 10.


Solution

  • SOLUTION: I had a different local User Variable set for JAVA_HOME but I didn't see, and couldn't access it because I needed administration rights to view them. When I accessed through administration rights I only saw the variables for the Administrator User.