5

I have just updated my local machine setup and now config of it is as -


******************************************************

Your system information:

Cordova CLI: 6.4.0 
Ionic CLI Version: 2.1.8
Ionic App Lib Version: 2.1.4
ios-deploy version: Not installed
ios-sim version: 5.0.8 
OS: OS X Yosemite
Node Version: v6.2.2
Xcode version: Xcode 7.2 Build version 7C68



******************************************************

Now i am getting error when i build for android (ionic build android) as-

Error: Requirements check failed for JDK 1.8 or greater

Need help!!!

S.Yadav
  • 4,273
  • 3
  • 37
  • 44

4 Answers4

11

If you are using Ubuntu, you could do the following, too:

sudo update-alternatives --config javac

That worked for me.

For more information about installing java/javac using update-alternatives, please refer to: How do I make java default to a manually installed JRE/JDK?

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
hlopezvg
  • 555
  • 5
  • 11
  • THANK YOU! I want to add that this fixes ionic codorva run as well. The error message kept saying to update JAVA_HOME but I had already updated it! – Zhinkk Feb 05 '19 at 03:59
4

I got solution of this issue,

It mean to say that I have older version of SDK, as per new setup it need at-least SDK-1.8 to get run build of the application.

For that I downloaded new version of SDK from here.
And then updated my SDK version using this article.

After that when I run this command-

ionic run android 

It worked for me.

S.Yadav
  • 4,273
  • 3
  • 37
  • 44
1

So I found that Ionic at the time of post-Cordova does not like JDK above 1.8.

  1. To Solve get JDK 8.
  2. Remove any JDK or JRE version higher than version 8 because it will automatically look for the highest version JDK the Java folder in c drive.

OR

  1. Next solution is to just change what JDK Cordova looks for to version 8.
  • I found this related post very helpful too https://stackoverflow.com/questions/40628240/cordova-requirements-check-failed-for-jdk-1-8-or-greater?noredirect=1&lq=1 – Nditah Apr 28 '19 at 11:31
0

This is my best option for my case, I use Cordova 6.2 version (not latest). I've worked with 1.7 Java as long as I can follow the technology from them. But since Cordova upgrade their system, now they prepare using 1.8 to implemented. If I not wrong, since 6.3 version their using that. I work in Snow Leopard with 1.7 java, it's hard to move on to upgrade my OS since I use old Macbook, I don't have several choice here.