As depicted in above image java home is set and is being echoed but when i check for version it gives me latest version. Already restarted the command prompt after setting env variable. OS is Windows 7
Update:
Following is the Path.
..ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;;%JAVA_HOME%/bin;
I had the same trouble and I solved it with the following steps:
You need the correct environment variables.
To be exactly correct, you only need to set the Path
variable.
You need to find where you add %JAVA_HOME%\bin
to the path.
Put it at first place in the Path
variable:
%JAVA_HOME%\bin;...
where ...
represents all other values of Path
.
I assume that JAVA_HOME
is defined as a variable and had the correct value.
After this reopen console and check:
java -version
JAVA_HOME
is environment variable that various application reads in their launcher script
when you invoke java
it looks up for all paths specified in your env variable named PATH
and wherever the first match is it gets picked up
so if you like command prompt to refer to jdk 6's Java append the path to PATH
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With