离子构建失败:JAVA_HOME无效 [英] Ionic Build Failed: JAVA_HOME is invalid
问题描述
我想从离子性开始我的第一个构建.但是构建很快就会失败,并出现以下错误:
I wanted to start my first build with ionic. But the Build fails very soon with the following error:
Running command: E:\Apps\ASV\Node\node.exe E:\Apps\ASV\Code\MyASV\hooks\after_prepare\010_add_platform_class.js E:\Apps\ASV\Code\MyASV
add to body class: platform-android
Error: Failed to run "java -version", make sure that you have a JDK installed.
You can get it from: http://www.oracle.com/technetwork/java/javase/downloads.
Your JAVA_HOME is invalid: C:\Program Files\java\jdk1.8.0_77
过去一个小时,我尝试了几种方法来解决此问题.我卸载了所有与Java相关的东西,重新安装了它,将JAVA_HOME设置为jdk路径几次,将%JAVA_HOME%\ bin添加到路径变量,但没有任何方法可以解决.目前,我必须手动创建的JAVA_HOME如下所示:
I tried several things over the past hour to fix this. I deinstalled all Java related stuff, reinstalled it, set the JAVA_HOME several times to the jdk path, added %JAVA_HOME%\bin to the path-variable, but nothing fixed it. Currently my JAVA_HOME, which i had to create manually, looks like this at the moment:
C:\Program Files\Java\jdk1.8.0_77
请注意,此路径与错误消息中的路径不同. "Java"是用小写字母还是大写字母编写的,我不知道这是否有意义.同样,更改此JAVA_HOME变量,然后尝试重新生成也会产生相同的错误,更改后的变量似乎对一种离子用法没有影响.
Please note that this path is different to the one in the error message. The 'Java' is written in lowercase and in uppercase, I don't know if this is relevant. Also changing this JAVA_HOME variable and then trying a rebuild gives the same error, the changed variable seems to have no effect on the one ionic uses.
我该如何解决?到底是哪里出了问题?
How can I fix this? What exactly is going wrong?
推荐答案
好的,我已修复它.错误
Okay, i fixed it. The Error
Your JAVA_HOME is invalid: C:\Program Files\java\jdk1.7.0_79
很烦人.错误是PATH变量缺少
Is quite irritating. The error was that the PATH-variable missed an entry like
C:\Program Files\Java\jdk1.7.0_79\bin
不知何故
%JAVA_HOME%\bin
仍然会导致错误.
这篇关于离子构建失败:JAVA_HOME无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!