After installing JDK 11 or above, my Visual Code Studio Terminal is still showing Java version 8 when using…
Java -v
Because…
“You may be wondering, if you’ve set
JAVA_HOME
andPATH
to point to JDK-11, why doesjava -version
still use Java 8?Take a look at your
PATH
and you’ll likely find something likeC:\ProgramData\Oracle\Java\javapath
as one of the first entries (see this). This entry was added automatically when you installed Java 8 and points to the Java 8 executables (java
,javaw
, andjavaws
). Since it’s before your%JAVA_HOME%\bin
entry, it takes precedence. However,...\javapath
doesn’t containjavac
and that’s whyjavac -version
usedJAVA_HOME
(Java 11).”
I just deleted the variable… all the Java 1.8 folders… and works.
FOR Gradle… Checking with
gradle -v
After installing it… just reopen VS Code