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

前端 未结 27 2318
星月不相逢
星月不相逢 2020-11-30 20:30

While running

sencha app build production

I am getting the following error:

Error: Registry key \'Software\\JavaSof

相关标签:
27条回答
  • 2020-11-30 20:58
    1. open regedit
    2. go to [HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment]
    3. change value CurrentVersion from "1.8" to "1.7"
    0 讨论(0)
  • 2020-11-30 20:59

    You have to define your jdk folder in variable JAVA_HOME, add %JAVA_HOME% to your variable path

    Delete or change name of your java.exe, javaw.exe and javaws in your folder system32

    execute cmd.exe, java -version now take the new version that you define in JAVA_HOME.

    0 讨论(0)
  • 2020-11-30 20:59

    One possible solution to this problem is to add at Sencha CMD folder a bat file as sugested at this thread Sencha Cmd 5 + Java 8 Error.

    The batch will have the name "sencha.bat" with this code:

    @echo off
    set JAVA_HOME=<YOUR JDK 7 HOME>
    set PATH=%JAVA_HOME%\bin;%PATH%
    set SENCHA_HOME=%~dp0
    java -jar "%SENCHA_HOME%\sencha.jar" %*
    

    Place it at sencha folder, in my case is

    C:\Users\<YOUR USER>\bin\Sencha\Architect\Cmd\6.2.0.103
    

    The following step is to change PATHEXT enviroment varible. Change at user variables to have the least impact possible.

    I change from

    COM;.CMD;.EXE;.BAT;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    

    to

    COM;.BAT;.EXE;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    

    The idea is to make windows run .bat files first than .exe files. This is important because in sencha folder there is already an "sencha.exe" file. And in the command line if you type "sencha" it will execute "sencha.exe" instead of "sencha.bat".

    This was the only solution that worked for because I'm very restricted when it comes to permissions.

    0 讨论(0)
提交回复
热议问题