Windows will run whatever Java is first in your PATH
. Therefore, you might want to check your environment variables and also check JAVA_HOME
, when you're at it.
Although you have set correctly JAVA_HOME
, Windows uses the first Java found in the PATH
. Remove the following entries as there are symlinks to files elsewhere:
C:\Program Files\Common Files\Oracle\Java\javapath
C:\ProgramData\Oracle\Java\javapath
Go to Environment variables > JAVA_HOME > Edit > paste the path of your JDK 11 here instead of JDK-8 path > Go to PATH and now paste the path of the bin folder of JDK 11 here and press ok
You can check the version of JDK now over CMD.
Explanation:
ClassPath decides where all commands will be present.Java code should be locatable & is located using classPath where you specify root directories of all projects that you want to run.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.