Invalid JAVA_HOME when build with cordova

回眸只為那壹抹淺笑 提交于 2019-12-04 23:51:58

Cordova needs a JDK not a JRE, since it is checking for javac. See check_reqs.js line 86. From your comments you are saying that "Inside this path, there isn't the bin folder" in a JDK you should have a bin directory!

In my specific case, I remove and reinstall all java packages and add one (for 'instinct'):
I removed:
java-1_8_0-openjdk
java-1_8_0-openjdk-headless
java-1_8_0-openjdk-plugin

And added:
java-1_8_0-openjdk
java-1_8_0-openjdk-headless
java-1_8_0-openjdk-plugin
java-1_8_0-openjdk-devel <<-- luckily I hit it

The bin inside main folder appears. With javac and another things.
Thank you guys!

Bilal Shah

Your path should be like this

PATH=$PATH:$ANDROID_HOME/bin:$JAVA_HOME/bin

and than export PATH

It's a bit of misunderstanding with java-X_X_X-openjdk packages. Especially when you are used to default Oracle notation.

The JDK part is confusing, because OpenJDK is a project of an open-source implementation of the Java Platform and not a JDK - package actually allowing you to develop in Java. (more precise info here: http://openjdk.java.net/install/index.html)

TLDR:

  1. java-X_X_X-openjdk is Oracle's JRE equivalent.

  2. java-X_X_X-openjdk-devel is Oracle's JDK equivalent.

Verifying java & JDK installations resolved my problem.. Install java & JDK and try..

To build and run apps, you need to install SDKs for each platform you wish to target. Alternatively, if you are using browser for development you can use browser platform which does not require any platform SDKs.

To check if you satisfy requirements for building the platform:

$ cordova requirements
Requirements check results for android:
Java JDK: installed .
Android SDK: installed
Android target: installed android-19,android-21,android-22,android-23,Google Inc.:Google APIs:19,Google Inc.:Google APIs (x86 System Image):19,Google Inc.:Google APIs:23
Gradle: installed

Requirements check results for ios:
Apple OS X: not installed
Cordova tooling for iOS requires Apple OS X
Error: Some of requirements check failed
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!