Registry error: Java version has a value of "1.8" but requires "1.7"

At startup

sencha app build production 

I get the following error:

Error: registry key 'Software \ JavaSoft \ Java Runtime Environment' \ CurrentVersion '

has a value of "1.8", but "1.7" is required. Error: could not find java.dll Error: could not find Java SE runtime.

java -version , the command shows the 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)

It is impossible to find where the path goes wrong. Any idea?

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

Note I am using Windows 7 (64 bit).

I tried to remove sencha touch cmd and reinstall. But still the same mistake.

I uninstalled all instances of the java version and reinstalled the latest version. Nevertheless, the problem remains.

+49
java java-8 sencha-touch sencha-touch-2 sencha-cmd
Apr 17 '15 at 11:08
source share
21 answers

After trying more than a hundred tricks, it finally worked out.

I deleted all java.exe , javaw.exe and javaws.exe from my

  • Windows\System32 and

  • Windows\SysWOW64 folder. [Try step 2 if you have an x64 system (Win 7 64 bit)]

+184
Apr 21 '15 at 10:16
source share
  • open regedit
  • go to [HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment]
  • the value of the CurrentVersion change from "1.8" to "1.7"
+21
Mar 03 '16 at 2:54 on
source share

In my case (64-bit version of Windows 7) I just did the following:

  • Removed link to C: \ ProgramData \ Oracle \ Java \ javapath; from the environment variable Path
  • Deleted java , javaw and javaws files from the folder C: \ Windows \ System32

Then I closed all open command line consoles, opened them again and ran java -version.

+18
Nov 17 '15 at 11:13
source share

re: Windows users

No. Do not remove the reference to the Javapath environment from your PATH variable.

The reason the registry does not work is because the Oracle Javapath script must run in the PATH sequence before the JRE and JDK directories - it will sort the current version:

put this directory in the HEAD of your %PATH% variable:

 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 

Then you will 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) 
+15
Apr 05 '16 at 18:45
source share

My experience:

I am using windows 8.1 and I downgraded the JAVA version from 1.8 to 1.7 and I was getting the same error.

Error: The registry key 'Software \ JavaSoft \ Ja has a value of "1.7" but requires "1.8".

I removed java.exe , javaw.exe and javaws.ex e from C: \ Windows \ System32 and it worked for me.

+4
Nov 01 '15 at
source share

I had the same problem. A simple solution that worked for me is to reorder the entries in PATH for the JRE/JDK . This problem arose after installing JRE 8 , the installation of which placed some executables in the System32 or SysWOW64 , these executables were confused. To fix the problem:

  • Create an environment variable pointing to the JDK home as JAVA_HOME .

    set JAVA_HOME=C:\Progra~1\Java\jdk1.8.0_45

  • Put the entry %JAVA_HOME%\bin at the beginning in the PATH environment variable. Adding an existing PATH value. For example:

    path=C:\Program Files\Java\jdk1.8.0_45\bin;%path%

+3
Feb 26 '16 at 16:44
source share

I did not delete any of the java.exe files, but changed the order of my System variable - "path" so that it reflected% JAVA_HOME% \ bin as the first entry. It did the trick.

+2
Jul 09 '16 at 15:04
source share

As for me on win7 64bit.

Copy java.exe to javaw.exe javaws.exe in the folder C:\Program Files\Java\jre1.8.0_91\bin to the C:\Windows\System32.

and then open cmd, enter java -version.

 C:\Users\HEcom>java -version java version "1.8.0_91" Java(TM) SE Runtime Environment (build 1.8.0_91-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode) 

Before above, make sure that Registry CurrentVersion 1.8

In the START menu, enter "regedit" to open the registry editor

  • Go to the "HKEY_LOCAL_MACHINE" section in the registry on the left explorer / tree menu
  • Click "SOFTWARE" in the registry "HKEY_LOCAL_MACHINE"
  • Click "JavaSoft" in the "SOFTWARE" registry.
  • Click "Java Runtime Environment" in the "JavaSoft" list here you can see different versions of installed java
  • Click "Java Runtime Environment" - on the right side you will get 4-5 lines. Select "CurrentVersion" and right-click (select modification) make sure version "1.8"
+1
May 10 '16 at 3:37
source share

My solution to this problem appeared after reading and checking all of the above.

In my case, I tried downgrading Java to use printouts in Apache ActiveMQ . After uninstalling all versions of Java and cleaning the registry, I got the same error

Error: The registry key 'Software \ JavaSoft \ Java Runtime Environment' \ CurrentVersion 'is set to "1.7", but "1.8" is required.

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

After establishing this fact, I simply switched them with the same files from the C:\Windows\SysWOW64 (which were from the JRE7 version), and all this worked fine.

+1
Mar 14 '17 at 8:26
source share

You must have Java 7 first. If you donโ€™t have it, install it first (I donโ€™t know what you are using, Linux, Mac, yum, apt, homebrew, you have to find out for yourself).

If you already have Java 7, run:

 echo $JAVA_HOME 

The result should be something like this: /usr/lib/jvm/java-8-oracle . Next to this directory you should see the java-7 directory. Once you find it, run

 export JAVA_HOME=${java-7-dir} 

Change {java-7-dir} to your directory path. Then you can run your team.

This is a temporary solution. To change it permanently, put the above command into the ~/.bashrc .

EDIT. If you are using Windows , change the JAVA_HOME environment variable to your path to the Java 7 installation directory.

0
Apr 17 '15 at 11:22
source share

My short contribution to sharing the same issue with the 64-bit version of Talend Open Studio.

  • Run .. \ TOS_DI-Win32-20150702_1326-V6.0.0 \ TOS_DI-win-x86_64.exe manually (do not bind the start menu in Windows)
  • and a registry error message appears

To resolve this issue, delete all java.exe, javaw.exe, and javaws.exe files in the c: \ ProgramData \ Oracle \ Java \ javapath \ directory

and TOS will start from the 64-bit version correctly!

0
Sep 09 '15 at 12:30
source share

Remove it from the system path:

 %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem 

And this will fix the problem when upgrading java version from 1.7 to 1.8

0
Dec 6 '15 at 1:37
source share

Aribeiro answer worked for me - with minor changes

  • I removed the link to C: \ ProgramData \ Oracle \ Java \ javapath; from environment variable
  • I made / path / to / jdkhome as the first entry in my PATH environment variable. I think this is the only thing needed.
0
Feb 16 '16 at 17:13
source share

There is somewhere else java.exe from version 1.8 that it is in the "path", you should find and delete it, if possible. it can be in custom tempdata for applications that require jre.

0
Nov 02 '16 at 7:09
source share

Please change the system variable JAVA_BIN and JAVA_HOME, and then restart the system or possibly reinstall. You have this error because it is the jdk1.7 path. In windows, it looks like this: enter image description here

0
Jan 18 '17 at 10:56 on
source share

Just install the Java SE Runtime Environment JRE 7!

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

It worked for me.

0
Jul 07 '17 at 6:41
source share

After the last automatic update of Java, I could not start Java from the command line.

My path variable had "C: \ ProgramData \ Oracle \ Java \ javapath;"

I could not write cd to 'C: \ ProgramData \ Oracle \ Java \ javapath;' from the command prompt window, since it was not there.

I deleted C: \ ProgramData \ Oracle \ Java \ javapath; 'from the path variable and replaced it with "C: \ Program Files \ Java \ jre1.8.0_141 \ bin;'

0
Jul 27 '17 at 18:35
source share

Unistall Java 8 from the list of programs. Follow the instructions below: -

On the desktop, click the Start menu (or Start Ball) in the lower left corner of the screen. Go to the control panel. Click "Programs and Features." Select Java8 and click Uninstall

-one
Jun 10 '16 at 15:32
source share

I had a similar problem. Moving the JDK and JRE path to the top of the path variable resolved the problem (which takes precedence over what is present in System32)

For example, here is mine:

enter image description here

-one
May 12 '17 at 10:23 a.m.
source share

Kill all java related applications in task manager and then remove Java.exe, Javaw.exe and Jawaws.exe from C: \ windows \ System32

This should solve your problem ... :)

-one
Aug 24 '17 at 13:12
source share

just did it and it worked

HKLM> SOFTWARE> JavaSoft> Java Runtime Environment

just change the current version to 1.7.

lol ... but it worked!

-3
Apr 09 '16 at 12:15
source share



All Articles