注册表项错误:Java 版本的值为“1.8”,但需要“1.7”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29697543/
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
Registry key Error: Java version has value '1.8', but '1.7' is required
提问by Anand Gupta
While running
在跑步的时候
sencha app build production
I am getting the following error:
我收到以下错误:
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.
错误:注册表项 'Software\JavaSoft\Java 运行时环境'\CurrentVersion'
具有值“1.8”,但需要“1.7”。错误:找不到 java.dll 错误:找不到 Java SE 运行时环境。
java -version
, command is showing following:
java -version
, 命令显示如下:
java version "1.8.0_40" Java(TM) SE Runtime Environment (build 1.8.0_40-b26) Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
java 版本“1.8.0_40”Java(TM) SE 运行时环境(构建 1.8.0_40-b26)Java HotSpot(TM) 64 位服务器 VM(构建 25.40-b25,混合模式)
Not able to find where path is going wrong. Any idea?
无法找到路径出错的地方。任何的想法?
----------------------- EDIT ------------------------------------------------
- - - - - - - - - - - - 编辑 - - - - - - - - - - - - - ---------------
Note: I am using Windows 7 (64 bit).
注意:我使用的是 Windows 7(64 位)。
I have tried uninstalling the sencha touch cmd and reinstalling. But still same error.
我试过卸载sencha touch cmd并重新安装。但还是同样的错误。
I have uninstalled all the java version instances and reinstalled the latest one, Still the problem persist.
我已经卸载了所有的java版本实例并重新安装了最新的实例,问题仍然存在。
采纳答案by Anand Gupta
After trying more than hundred of tricks, finally got success.
尝试了百余招,终于成功了。
I removed all java.exe
, javaw.exe
and javaws.exe
from my
我删除了所有java.exe
,javaw.exe
并javaws.exe
从我的
Windows\System32
andWindows\SysWOW64
folder. [Try step 2 if you have x64 system (Win 7 64 bits)]
Windows\System32
和Windows\SysWOW64
文件夹。[如果您有 x64 系统(Win 7 64 位),请尝试第 2 步]
回答by mtyurt
First you should have Java 7. If you don't have, install it first (I don't know what you are using, Linux, Mac, yum, apt, homebrew, you should find out yourself.)
首先你应该有Java 7。如果你没有,先安装它(我不知道你在用什么,Linux,Mac,yum,apt,homebrew,你应该自己找出来。)
If you already have Java 7, run:
如果您已经拥有 Java 7,请运行:
echo $JAVA_HOME
Output should be something like this:/usr/lib/jvm/java-8-oracle
. Near this directory, you should see java-7
directory. After you found it, run
输出应该是这样的:/usr/lib/jvm/java-8-oracle
. 在此目录附近,您应该会看到java-7
目录。找到后,运行
export JAVA_HOME=${java-7-dir}
Change {java-7-dir}
with your directory path. Then you can run your command.
更改{java-7-dir}
您的目录路径。然后你可以运行你的命令。
This is only a temporary solution.To change it permanently, put the above command to your ~/.bashrc
file.
这只是一个临时解决方案。要永久更改它,请将上述命令放入您的~/.bashrc
文件中。
EDIT: If you are using Windows, change environment variable of JAVA_HOME
to your Java 7 installation directory path.
编辑:如果您使用的是 Windows,JAVA_HOME
请将环境变量 of 更改为您的 Java 7 安装目录路径。
回答by Undigo Factory
My short contribution, for sharing the same problem with Talend Open Studio 64 bit version.
我的简短贡献,用于分享与 Talend Open Studio 64 位版本相同的问题。
- Launch ..\TOS_DI-Win32-20150702_1326-V6.0.0\TOS_DI-win-x86_64.exe manually (not link an startup Windows menu)
- and this registry error message appears
- 手动启动 ..\TOS_DI-Win32-20150702_1326-V6.0.0\TOS_DI-win-x86_64.exe(不链接启动 Windows 菜单)
- 并出现此注册表错误消息
To resolve this, remove all java.exe, javaw.exe and javaws.exe files on c:\ProgramData\Oracle\Java\javapath\
要解决此问题,请删除 c:\ProgramData\Oracle\Java\javapath\ 上的所有 java.exe、javaw.exe 和 javaws.exe 文件
and TOS start with 64 bits version correctly !
和 TOS 以 64 位版本正确开始!
回答by RJ_Singh
My experience:
我的经验:
I am using windows 8.1and i have downgraded JAVA version from 1.8 to 1.7 and i was getting the same error.
我使用的是 Windows 8.1,我已经将 JAVA 版本从 1.8 降级到 1.7,但我遇到了同样的错误。
Error: Registry key 'Software\JavaSoft\Ja has value '1.7', but '1.8' is required.
错误:注册表项“Software\JavaSoft\Ja 的值为“1.7”,但需要“1.8”。
I have deleted java.exe, javaw.exeand javaws.exe from C:\Windows\System32folder and it worked for me.
我已经从C:\Windows\System32文件夹中删除了java.exe、javaw.exe和javaws.exe并且它对我有用。
回答by aribeiro
In my case (Windows 7 64-bit), I just did the following:
就我而言(Windows 7 64 位),我只执行了以下操作:
- Removed the reference to C:\ProgramData\Oracle\Java\javapath;from the Pathenvironment variable
- Removed files java, javawand javawsfrom the C:\Windows\System32folder
- 删除了对C:\ProgramData\Oracle\Java\javapath 的引用;来自Path环境变量
- 从C:\Windows\System32文件夹中删除文件java、javaw和javaws
Afterwards, I closed all open command line consoles, reopened them and ran java -version.
之后,我关闭了所有打开的命令行控制台,重新打开它们并运行java -version。
回答by user5645373
Remove it from the System path:
从系统路径中删除它:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem
And it will fix the issue in upgrading java version from 1.7 to 1.8
它将解决将 Java 版本从 1.7 升级到 1.8 的问题
回答by abdel
aribeiro answer has worked for me - with minor changes
aribeiro 的答案对我有用 - 稍作改动
- I Removed the reference to C:\ProgramData\Oracle\Java\javapath; from the Path environment variable
- I made /path/to/jdkhome as the first entry in my PATH environment variable. I think this alone is all that is needed.
- 我删除了对 C:\ProgramData\Oracle\Java\javapath 的引用;来自 Path 环境变量
- 我将 /path/to/jdkhome 作为 PATH 环境变量中的第一个条目。我认为仅此一点就足够了。
回答by pratikch
I've had the same problem. Simple solution that worked for me is to rearrange the entries in the PATH
for JRE/JDK
. This problem started to appear after installing JRE 8
whose installation has put some executable files in System32 or SysWOW64
directories, these executable files are messing up. To resolve the problem:
我遇到了同样的问题。对我有用的简单解决方案是重新排列PATH
for 中的条目JRE/JDK
。安装后开始出现这个问题,JRE 8
其安装System32 or SysWOW64
目录中有一些可执行文件,这些可执行文件乱七八糟。要解决问题:
Create environment variable pointing to JDK home as
JAVA_HOME
.set JAVA_HOME=C:\Progra~1\Java\jdk1.8.0_45
Put the entry
%JAVA_HOME%\bin
at start in your PATH environment variable. Appending existing value ofPATH
. For example:path=C:\Program Files\Java\jdk1.8.0_45\bin;%path%
创建指向 JDK home 的环境变量作为
JAVA_HOME
.set JAVA_HOME=C:\Progra~1\Java\jdk1.8.0_45
将条目
%JAVA_HOME%\bin
放在 PATH 环境变量中。附加 的现有值PATH
。例如:path=C:\Program Files\Java\jdk1.8.0_45\bin;%path%
回答by lucken
- open regedit
- go to
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment]
- change value
CurrentVersion
from "1.8" to "1.7"
- 打开注册表
- 去
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment]
- 将值
CurrentVersion
从“1.8”更改为“1.7”
回答by Andrew
re: Windows users
回复:Windows 用户
No. Don't remove the Javapath environment reference from your PATH variable.
不。不要从 PATH 变量中删除 Javapath 环境引用。
The reason why the registry didn't work is that the Oracle Javapath script needs to run in the PATH sequence ahead of the JRE & JDK directories - it will sort out the current version:
注册表不工作的原因是Oracle Javapath脚本需要在JRE & JDK目录之前的PATH序列中运行——它会整理当前版本:
put this directory at the HEAD of your %PATH%
variable:
将此目录放在%PATH%
变量的 HEAD 中:
C:\ProgramData\Oracle\Java\javapath
[or wherever it is on your desktop]
[或桌面上的任何位置]
so your PATH will look something like this - mine for example
所以你的路径看起来像这样 - 例如我的
PATH=C:\ProgramData\Oracle\Java\javapath;<other path directories>;E:\Program Files\Java\jdk1.8.0_77\bin;E:\Program Files\Java\jre1.8.0_77\bin
You will then see the correct, current version:
然后,您将看到正确的当前版本:
C:\>java -version
java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)