Java 如何知道我机器上的jdk版本?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/57363446/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to know the jdk version on my machine?
提问by Mayank Kataria
I have recently uninstalled JDK 11and installed JDK 8. For confirmation, I want to check which JDK is installed on my Windows 10machine. I typed java -version
on cmd then get the error message
我最近卸载了JDK 11并安装了JDK 8。为了确认,我想检查我的Windows 10机器上安装了哪个 JDK 。我输入java -version
cmd 然后收到错误消息
java is not recognized as an internal or external command
java 不被识别为内部或外部命令
Question:How to know which JDK version installed on pc?
问题:如何知道电脑上安装了哪个JDK版本?
采纳答案by ganga
you might need to add path
in environment variables which you can find in Control Panelopen the Jdkwhere you installed and add until /bin
in the path in environment variables.
您可能需要添加path
环境变量,您可以在控制面板中找到这些变量,
打开安装的Jdk并添加到/bin
环境变量的路径中。
Add until /bin
in path variable in System Variableswhich is residing in Environment Variables.
添加到/bin
在PATH变量系统变量这是居住在环境变量。
Then do
java -version
which might show up.
然后做
java -version
哪些可能会出现。
If still problem persists, try restarting your pc and see.
如果问题仍然存在,请尝试重新启动您的电脑并查看。
回答by tarik
You need to update your Windows path
to include your %JAVA_HOME%\bin
directory. %JAVA_HOME%
is the directory that you installed Java into and is also an environment variable that you need to configure for command line execution of your applications. You can edit both of these in the Windows control panel and you should restart.
您需要更新您的 Windowspath
以包含您的%JAVA_HOME%\bin
目录。%JAVA_HOME%
是您安装 Java 的目录,也是您需要为应用程序的命令行执行配置的环境变量。您可以在 Windows 控制面板中编辑这两个,然后重新启动。
When you run java -version
you will see the internal version number. This is explained here: https://en.wikipedia.org/wiki/Java_version_history.
当您运行时,java -version
您将看到内部版本号。这在这里解释:https://en.wikipedia.org/wiki/Java_version_history。
Basically, you can ignore the 1.
when reading version number. The _xxx
is a reference to the most recent patch or build release.
基本上,您可以1.
在阅读版本号时忽略。该_xxx
是到最近的补丁或建立版本的参考。