欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

JAVA_HOME从jdk8变到jdk7错误:Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersi

程序员文章站 2022-04-19 21:27:23
...
电脑装了jdk8,JAVA_HOME也是设置的8. 
不删除8变回7. 
改了JAVA_HOME,并且path值里的C:\ProgramData\Oracle\Java\javapath也删了 
运行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.

solution 
1. 打开开始菜单,搜索regedit,打开注册表 
2. 打开”HKEY_LOCAL_MACHINE” 
3. 点击”SOFTWARE” 
4. 点击”JavaSoft” 
5. 点击”Java Runtime Environment” 
6. 选中”CurrentVersion” ,右键点击更改,改成”1.7” 
问题解决了