Sencha Cmd 5 + Java 8 错误 [英] Sencha Cmd 5 + Java 8 Error

查看:31
本文介绍了Sencha Cmd 5 + Java 8 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 Windows 构建服务器上安装 Java 8 JDK 后,我在执行 sencha 命令时遇到以下错误:

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.

Sencha Cmd 指南暗示 Java 8 尚不受支持(但是 Sencha Cmd 在我的带有 Java 8 的 Mac OS X 工作站上运行良好):

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 需要 Java Runtime Environment 1.7 版才能支持所有功能...

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

我仍然在服务器上安装了 JDK 7.有没有办法强制 Sencha Cmd 使用不同的 JDK 安装?更改 JAVA_HOME 和 PATH sysenvs 不起作用,并且无法编辑注册表.

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.

更新:我遇到过这个问题 其中多个 java.exe 文件导致相同的错误(这里绝对有可能)但是 maven、ant、tomcat、jenkins 和许多其他 Java 工具都运行良好.我只在 Sencha Cmd 中看到过这个错误.

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.

推荐答案

为了更具体一点,我按照 Ben 的建议在我的安装目录中创建了以下 sencha.bat 文件:>

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" %*

然后我将现有的 sencha.exe 重命名为无害的东西.现在我可以简单地在命令行中输入sencha"而不必大惊小怪.当然,如果您有不同的 Java 7 次要版本,则需要编辑上面的 JAVA_HOME.

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.

这篇关于Sencha Cmd 5 + Java 8 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆