[英]Why is my java -version showing " openjdk version "1.8.0_282" "
Windows will run whatever Java is first in your PATH
. Windows 将运行 Java 在您的
PATH
中首先出现的任何内容。 Therefore, you might want to check your environment variables and also check JAVA_HOME
, when you're at it.因此,您可能需要检查环境变量并检查
JAVA_HOME
,当您使用它时。
Although you have set correctly JAVA_HOME
, Windows uses the first Java found in the PATH
.尽管您已正确
JAVA_HOME
,但 Windows 使用在PATH
中找到的第一个 Java 。 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 Go 到环境变量 > JAVA_HOME > 编辑 > 在此处粘贴 JDK 11 的路径而不是 JDK-8 路径 > Go 到PATH并现在将 JDK 11 的 bin 文件夹的路径粘贴到此处,然后按确定
You can check the version of JDK now over CMD.您现在可以通过 CMD 检查 JDK 的版本。
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. ClassPath 决定所有命令将出现在哪里。Java 代码应该是可定位的,并且使用您指定要运行的所有项目的根目录的 classPath 定位。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.