After installing JDK 11 or above, my Visual Code Studio Terminal is still showing Java version 8 when using…

Java -v


“You may be wondering, if you’ve set  JAVA_HOME  and  PATH  to point to JDK-11, why does  java -version  still use Java 8?

Take a look at your  PATH  and you’ll likely find something like  C:\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 ( javajavaw , and  javaws ). Since it’s before your  %JAVA_HOME%\bin  entry, it takes precedence. However,  ...\javapath  doesn’t contain  javac  and that’s why  javac -version  used  JAVA_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