Registry key Error: Java version has value '1.8', but '1.7' is required

208,297

Solution 1

After trying more than hundred of tricks, finally got success.

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

  1. Windows\System32 and

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

Solution 2

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

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

Afterwards, I closed all open command line consoles, reopened them and ran java -version.

Solution 3

  1. open regedit
  2. go to [HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment]
  3. change value CurrentVersion from "1.8" to "1.7"

Solution 4

re: Windows users

No. Don't remove the Javapath environment reference from your PATH variable.

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:

put this directory at 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

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)

Solution 5

My experience:

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

Error: Registry key 'Software\JavaSoft\Ja has value '1.7', but '1.8' is required.

I have deleted java.exe, javaw.exe and javaws.exe from C:\Windows\System32 folder and it worked for me.

Share:
208,297
Anand Gupta
Author by

Anand Gupta

I am a software evangelist and currently working with Capgemini. Love open source hence contributing.

Updated on August 07, 2021

Comments

  • Anand Gupta
    Anand Gupta almost 3 years

    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.

  • mtyurt
    mtyurt about 9 years
    @AnandGupta I added Windows case.
  • Aditya K
    Aditya K about 9 years
    In case of Linux, you need to provide the path to the Java binary in JAVA_HOME. For example, /usr/java/jdk1.5.0_07/bin/java. In case of Windows, just the installation directory should do.
  • Vinay Prajapati
    Vinay Prajapati over 8 years
    Could you tell us why?
  • Krish
    Krish about 8 years
    Thanks. It solved my problem. I don't have permissions to delete anything under SysWOW64. Simply changing CurrentVersion through regedit solved my problem.
  • Riwels
    Riwels about 8 years
    This is a really bad idea. The binaries folder must be added to path instead of moving files to a folder already in path. It can cause a horrible headache if someone else has to update java on the system and has not knowledge about this "solution". And that's exactly the op's problem source... Fix your path instead.
  • Matthieu
    Matthieu almost 8 years
    Change I just MOVE into I just COPY and you'll be good to go.
  • Heinz
    Heinz over 7 years
    this is the best solution if you want to keep multiple versions of java side by side, and if you you don't have the privilege to modify the registry and remove files from the windows\system folder.
  • iTurki
    iTurki about 7 years
    Win 10 64Bit users: deleting the 3 files in System32 will solve the issue.
  • uhm
    uhm about 7 years
    I had this issue on Windows 10 when installing JDK5u14, JDK6u34, JDK7u51 and JDK8u121 (in that order). Removing the java files from Windows folder was not sufficient. Had also to remove path from the PATH environment variable.
  • C.B.
    C.B. about 7 years
    But we have to close and re-open the cmd and type java -version to view the changes... Worked like a charm thanks!
  • Underverse
    Underverse almost 7 years
    This will not work if there are other java executables for other Java versions in the path.
  • GhostCat
    GhostCat almost 7 years
    This is much more a comment than an answer. The question is about a very specific tool, and making very clear that java is in deed found.
  • softwarelover
    softwarelover almost 7 years
    This one works for me. I have Windows 7 (64-bit). I have moved C:\ProgramData\Oracle\Java\javapath to the beginning of PATH, as you suggested. Thanks!
  • Anand Gupta
    Anand Gupta almost 7 years
    @SkepticScribbler: This happens when you somehow confused java itself. You are trying to run a java 7 VM where it found a JRE 8. It might show this problem even if you type in the command line just java or java -version in a misconfigured environment.
  • Muhammad Mamoor Khan
    Muhammad Mamoor Khan over 6 years
    can you please make it clear how would that solve the issue at hand?
  • Fred Andrews
    Fred Andrews about 6 years
    A much simpler solution than trying to delete all the extraneous java versions!
  • Sandoval0992
    Sandoval0992 almost 6 years
    Hey it worked! Don't forget to restart your computer, thanks.
  • masseyb
    masseyb over 5 years
    @AnandGupta this is a shot in the dark, not a solution - stackoverflow.com/a/53192247/1423507
  • user508402
    user508402 about 5 years
    .. however, it does not solve anything. Then the installer complains and justly so, that java 8 is required.
  • masseyb
    masseyb over 4 years
    @whoever_that_downvotes - this answer can't be enhanced without any constructive feedback. Drop a comment as to "why" and might be able to make this answer better for the benefit of the community.
  • Abhishek Sawant
    Abhishek Sawant almost 4 years
    Thanks this solution worked was trying to solve this error for long time
  • Waqas
    Waqas over 3 years
    Warning: It may mess up with your other applications which are configured to use 1.8.