CordovaError: Failed to find 'JAVA_HOME' environment variable. Try setting it manually

你。 提交于 2021-01-07 01:03:05

问题


I get a ionic project from a person, and I want to debug it in a real android device.
I use this command:

ionic cordova run android --device --verbose

And in the end I get these error messages:

Preparing Firebase on Android
No scripts found for hook "before_compile".
Failed to find 'JAVA_HOME' environment variable. Try setting it manually.
CordovaError: Failed to find 'JAVA_HOME' environment variable. Try setting it manually.

I have JAVA_HOME set, indeed if I do echo $JAVA_HOME I get:

/usr/lib/jvm/java-1.11.0-openjdk-amd64

According to Failed to find 'JAVA_HOME' environment variable. Try setting it manually post, I also tried adding bin folder to JAVA_HOME variable, without any success.

If I also try java -version and javac -version I get success messages.


回答1:


SOLVED

Version 10.0.0 of Cordova requires jdk version 8. That's it.



来源:https://stackoverflow.com/questions/65286857/cordovaerror-failed-to-find-java-home-environment-variable-try-setting-it-ma

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!