6

After installing Java 8 JDK on my Windows build server, I'm running into the following error when executing the sencha command:

C:\> sencha

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.

The Sencha Cmd Guide implies that Java 8 isn't supported yet (however Sencha Cmd works fine on my Mac OS X workstation with Java 8):

Sencha Cmd requires Java Runtime Environment version 1.7 to support all functionality...

I've still got JDK 7 installed on the server. Is there any way to force Sencha Cmd to use a different JDK install? Changing JAVA_HOME and PATH sysenvs does not work, and editing the registry isn't an option.

UPDATE: I've run across this question where multiple java.exe files cause the same error (and that's definitely a possibility here) however maven, ant, tomcat, jenkins, and a slew of other Java tools are working fine. I've only seen this error with Sencha Cmd.

Community
  • 1
  • 1
sherb
  • 5,845
  • 5
  • 35
  • 45

4 Answers4

9

To make this slightly more concrete, I followed ben's advice and created the following sencha.bat file in my installation directory:

@echo off
set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_75
set PATH=%JAVA_HOME%\bin;%PATH%
set SENCHA_HOME=%~dp0
java -jar "%SENCHA_HOME%\sencha.jar" %*

and I renamed the existing sencha.exe to something innocuous. Now I can simply type "sencha" at the command line without extra fuss. Of course, if you have a different minor version of Java 7, you'll need to edit the JAVA_HOME above.

vanmelle
  • 1,605
  • 1
  • 14
  • 22
  • Great! With this solution, there is no need to manipulate the registry or path environment variables or downgrade android tools or something else. – Markus Nov 23 '16 at 13:31
  • This is a good solution, it seems like the sencha.exe is not respecting or is otherwise resetting the PATH environment variable. – Nick Spacek Apr 06 '17 at 13:56
7

My 'Path' environment variable are mapping 'C:\ProgramData\Oracle\Java\javapath' which contains 3 shortcuts for following files from 'C:\Program Files\Java\jre1.8.0_xx\bin':

  • java.exe
  • javaw.exe
  • javaws.exe

But these files are also present in 'C:\Windows\System32'; if you call 'java' from this directory you will have the same error (Error: Registry key...) By replacing these 3 files in 'C:\Windows\System32' by the one's from 'C:\Program Files\Java\jre1.8.0_xx\bin'; it will solve the issue.

korgoth
  • 191
  • 2
  • 6
  • This was the issue for me, thanks! You can test to see if this is your issue by simply renaming these files with a .old extension in the System32 directory and then re-running. If this was the problem, the errors will simply go away :) – pje Feb 02 '16 at 22:07
3

Try the following workaround to use the latest SenchaCMD working with JDK8:

  1. check your PATH environment variable; especially the correct java installation path(s)
  2. open the command prompt and go to the sencha-cmd folder
  3. to use SenchaCMD just execute the "sencha.jar"-file with java:

    java -jar sencha.jar
    

Now, you should see all version informations about the executed SenchaCMD-Tool.

Tested with JDK 1.8.0u25 and SenchaCMD 5.1.0.26 on W7 Prof. x64

ben
  • 31
  • 1
0

I had this exact same thing, found that I was required to update the sencha cmd itself. I had extjs 5.1 cmd 5.1.0 , downloaded extjs 6.0.1 and tried to sencha app upgrade {new_extjs6_path} my app. Received the above error, figured out I was required to update cmd to 6.0.1 as well.

dfox
  • 41
  • 1