I created an android project using Cordova 5.0.0
and am trying to compile it. I am using the command: ant release
我使用Cordova 5.0.0创建了一个android项目,我正在尝试编译它。我正在使用命令:ant release
I get the following output:
我得到以下输出:
Error: JAVA_HOME is not defined correctly. We cannot execute /System/Library/Frameworks/JavaVM.framework/Home/bin/java
错误:未正确定义JAVA_HOME。我们无法执行/System/Library/Frameworks/JavaVM.framework/Home/bin/java
So, I changed the JAVA_HOME
variable in the .bash_profile
file to the value below as directed on one of these threads:
因此,我将.bash_profile文件中的JAVA_HOME变量更改为以下值,如下所示:
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
I used the echo command to verify that the JAVA_HOME
variable was set.
我使用echo命令来验证是否设置了JAVA_HOME变量。
I still receive the same output when compiling with ant relase. It doesn't recognize the change that I made to the value.
在使用ant relase进行编译时,我仍然会收到相同的输出。它无法识别我对该值所做的更改。
What am I doing wrong?
我究竟做错了什么?
Any help is much appreciated.
任何帮助深表感谢。
1 个解决方案
#1
The error seems to say it can't execute your java binary. It's probably the wrong location or the wrong access?
该错误似乎表明它无法执行您的java二进制文件。这可能是错误的位置或错误的访问?
Try typing this in your console to see what type of error you get /System/Library/Frameworks/JavaVM.framework/Home/bin/java
尝试在控制台中输入此内容,以查看您获得的错误类型/System/Library/Frameworks/JavaVM.framework/Home/bin/java
If it's not found, JAVA_HOME is wrong. The path you are setting JAVA_HOME to is the same JAVA_HOME it's currently using. It just appends /bin/java for the executable
如果找不到,JAVA_HOME错了。您将JAVA_HOME设置为的路径与当前使用的JAVA_HOME相同。它只是附加/ bin / java的可执行文件
#1
The error seems to say it can't execute your java binary. It's probably the wrong location or the wrong access?
该错误似乎表明它无法执行您的java二进制文件。这可能是错误的位置或错误的访问?
Try typing this in your console to see what type of error you get /System/Library/Frameworks/JavaVM.framework/Home/bin/java
尝试在控制台中输入此内容,以查看您获得的错误类型/System/Library/Frameworks/JavaVM.framework/Home/bin/java
If it's not found, JAVA_HOME is wrong. The path you are setting JAVA_HOME to is the same JAVA_HOME it's currently using. It just appends /bin/java for the executable
如果找不到,JAVA_HOME错了。您将JAVA_HOME设置为的路径与当前使用的JAVA_HOME相同。它只是附加/ bin / java的可执行文件