Rednaxelus
Rednaxelus

Reputation: 111

"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.

Upvotes: 2

Views: 4169

Answers (2)

proDucktive Mary
proDucktive Mary

Reputation: 11

For when you have a corporate/job laptop which is kinda restricted for other users; I went into the Registry editor, went into every user in HKEY_USERS and checked / changed the paths there accordingly.

Upvotes: -1

Rednaxelus
Rednaxelus

Reputation: 111

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.

Upvotes: 3

Related Questions