Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to change Java Version in windows

Tags:

java

windows

Previously I am using Java 1.8 in my machine. But now i need to use Java 1.6. So I changed the below values in system environment variables.

JAVA_HOME

U:\POC\jdk1.6.0_31

PATH

U:\POC\jdk1.6.0_31\bin\ or %JAVA_HOME%/bin

Also I restarted my system

Even after that it is displaying java version as 1.8 in my command prompt.

command Prompt

Can anyone advice on how to resolve this issue?

like image 990
Aravind Avatar asked Aug 22 '26 12:08

Aravind


2 Answers

when latest version is installed in system it automatically set javapath in environment variable like "C:\ProgramData\Oracle\java\javapath". Remove this from environment variables.enter image description here

like image 173
Mandeep Singh Gill Avatar answered Aug 25 '26 01:08

Mandeep Singh Gill


This suggestion may seem obvious, but I urge you to carefully consider this advice.

I have encountered this issue before, and frequently, it has been due to an overlooked entry within the long list of items making up the Windows Path. It is often an path entry where it is not immediately obvious that any of the java executables (javaw.exe, javaw.exe or javaws.exe) may reside. A common culprit is C:\ProgramData\Oracle\Java\javapath

You will therefore need to push upwards, your desired java/bin path above these. If in doubt, push it right to the top!

In the unlikely event that this does not work, then try making changes from within the java admin console (Control Panel --> Java --> Java tab --> View Button).

like image 34
IqbalHamid Avatar answered Aug 25 '26 02:08

IqbalHamid



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!