Registry key Error: Java version has value '1.

2019-01-08 08:00发布

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.

java -version , command is showing following:

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)

Not able to find where path is going wrong. Any idea?

----------------------- EDIT ------------------------------------------------

Note: I am using Windows 7 (64 bit).

I have tried uninstalling the sencha touch cmd and reinstalling. But still same error.

I have uninstalled all the java version instances and reinstalled the latest one, Still the problem persist.

25条回答
你好瞎i
2楼-- · 2019-01-08 08:50

aribeiro answer has worked for me - with minor changes

  • 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.
查看更多
倾城 Initia
3楼-- · 2019-01-08 08:50

There exist somewhere another java.exe from jre version 1.8 that it is in "path" you should find and delete it if it is possible. it may be in user tempdata for applications that need jre.

查看更多
三岁会撩人
4楼-- · 2019-01-08 08:50

Just Install Java SE Runtime Environment JRE 7 !

Now you see "java 7" & "java 8" in "Programs and Features" in the "Control Panel"

It worked for me.

查看更多
放荡不羁爱自由
5楼-- · 2019-01-08 08:50

My System:- Windows 8.1

Java Environments

  • C:\JavaEnvironment\Java\jdk1.8.0_161
  • C:\JavaEnvironment\Java\jdk1.7.0_75

I recently installed Oracle 11g XE and I received the mentioned error message when accessed "java" command at command prompt.

I checked my environment variables, checked the sequence (as mentioned by previous replies) and detected that my system PATH variable had following entry as first entry:

C:\OracleDatabase\oraclexe\app\oracle\product\11.2.0\server\bin;

I changed the sequence and defined JDK path as first entry:

enter image description here

I replicated the same change to User Variable: Path

enter image description here

After finishing the above activity, I restarted the command prompt and executed java -version command and the problem had vanished. It displayed Java 8 as the current version.

查看更多
小情绪 Triste *
6楼-- · 2019-01-08 08:51

My solution for this problem came after reading and trying all of the above.

In my case I tried to downgrade Java to use printouts in Apache ActiveMQ. After uninstalling all Java versions and cleaning the registry I was getting the same error

Error: Registry key 'Software\JavaSoft\Java Runtime Environment'\CurrentVersion' has value '1.7', but '1.8' is required."

In my case I needed to go to environment variables, edit path, open the javapath location (C:\ProgramData\Oracle\Java\javapath) and there it was - three files (java.exe, javaw.exe, javaws.exe) that remained from the JRE8 version.

After establishing this fact I simply switched them with the same files from C:\Windows\SysWOW64 directory (those were from the JRE7 version) and it all worked perfectly.

查看更多
smile是对你的礼貌
7楼-- · 2019-01-08 08:51

just did this and it worked

HKLM > SOFTWARE > JavaSoft > Java Runtime Environment

just manually change current version to 1.7 .

lol ... but it worked!

查看更多
登录 后发表回答