运行java -version 出现错误解决办法 has value '1.8', but '1.7' is required.

当运行 java -version 出现一下错误

C:\Windows\system32>java -version
Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion'
has value '1.8', but '1.7' is required.
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.

解决方案:

移除系统变量里面的java Path变量:

path:  C:\Program Files (x86)\Common Files\Oracle\Java\javapath

然后将当前java变量移动到顶部

运行java -version 出现错误解决办法 has value '1.8', but '1.7' is required._第1张图片

可以参考: https://blog.csdn.net/superit401/article/details/70154993

你可能感兴趣的:(运行java -version 出现错误解决办法 has value '1.8', but '1.7' is required.)