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.
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.
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':
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With