Reputation: 2107
I have restarted my cmd line after setting the environment variables. Javac is set to version 11, but java is still set to 8?
I have set my path variables like this:
There are no entries from other java versions in my Path variables like in this question: Installed Java 14 but Java -version still showing old Java
I have double checked that java.exe and javac.exe are in fact at location C:\Program Files\Java\jdk-11.0.7\bin:
I have read the other questions to this problem on Stackoverflow, but it was always that they set a wrong path, forgot to append /bin or had old paths to other java versions in their environment variables. I also tried reinstalling Java 11 and restarting the computer (as last idea). What else could I try?
Upvotes: 6
Views: 12658
Reputation: 200
I made 2 changes in order to reflect java -version as Java11
Upvotes: 0
Reputation: 79075
Move %JAVA_HOME%\bin
to the top and then check java -version
in a new cmd window. Make sure you do it in both, User variables
as well System variables
. Check this to learn more about a similar problem and its solution.
Upvotes: 4
Reputation: 825
You can also put in your system variables:
This will work and you will have java 11.
Upvotes: 1
Reputation: 10988
This can be caused by multiple different reasons.
Try 'where java' and 'where javac' to see where they point to. You should thenbe able to find the exact path from where java and javac are being called in your environment.
Also ensure that you only have one jdk/jre in your Path. You can try to move %JAVA_HOME% to be the first element in the Path list.
Upvotes: 4