I tried to update my Java version from 1.8 to 11 ON WINDOWS 10 to work with Android Studio and Flutter. I configured the JAVA_HOME environment variable to point to JDK 11 and removed any references to Java 1.8 from the PATH. However, when I run java -version
, I still get an error related to version 1.8. How can I resolve this issue and make sure my environment is using the correct Java version?
I configured the JAVA_HOME environment variable to point to JDK 11 and removed any references to Java 1.8 from the PATH and from the computer too (deleted all versions except the 11th)
When I tried javac -version
it prints the right version (javac 11.0.16.1)
But when I execute java -version
it shows this message
Error: could not open `C:\Program Files\Java\jre1.8.0_251\lib\amd64\jvm.cfg'
Can anyone help please ?