Java版本没有在Windows上更改
以前,我有Java 1.8.0_131
,然后我安装了JDK 1.8.0_102
。然后更改了环境变量中的版本,但是在检查cmd
中的Java版本时,它仍显示Java 1.8.0_131
。有什么解决方案吗?
Previously I had Java 1.8.0_131
, then I installed JDK 1.8.0_102
. Then changed the version in environment variables also, but while checking the Java version in cmd
it's still showing Java 1.8.0_131
. Any solution to this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我想您已经尝试了路径等的明显方法,所以也许您打破了符号链接。
因此,尝试在终端中写下以下权利的命令:(
根据计算机的路径调整路径)
I guess you have already tried the obvious ways with paths etc, so maybe you broke the symbolic links.
So, try to write the following commands in the terminal with elevated rights:
(Adjust the path according to the paths of your computer)
确保您仅安装了1个版本的Java 1.8,并在控制面板中卸载其他版本:
Make sure that you have installed only 1 version of java 1.8 and uninstall the others in the control panel like this:
请按照本教程的第一部分的说明更改Windows中的Java版本用于设置默认Java版本。
然后,使用Windows批处理文件(例如这些文件)在Java版本之间切换:
activateJava_8.bat:
activateJava_11.bat
根据您的已安装版本和目录更改Java_home。
要检查环境变量按预期更改,请在命令行上运行以下命令:
Please follow instructions in first part of this tutorial How to Change Java Versions in Windows for setting your default Java version.
Then use Windows batch files such as these for switching between Java versions:
ActivateJava_8.bat:
ActivateJava_11.bat
Change JAVA_HOME based on your installed version and directory.
To check that Environment variables are changed as expected, run following commands on command line: