Requirements check failed for JDK 1.8 or greater
See original GitHub issueI trying to publish my app but doesnt work
java version
huseyin-MacBook-Pro:city huseyinsolmaz$ java -version
java version "10.0.1" 2018-04-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)
huseyin-MacBook-Pro:city huseyinsolmaz$
ionic info ` huseyin-MacBook-Pro:city huseyinsolmaz$ ionic info
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : not installed
Gulp CLI : CLI version 3.9.1 Local version 3.9.1
local packages:
Cordova Platforms : none
Ionic Framework : ionic1 1.3.3
System:
Node : v8.11.1
npm : 5.6.0
OS : macOS High Sierra
Xcode : Xcode 9.3 Build version 9E145
Environment Variables:
ANDROID_HOME : /Development/android-sdk/
Misc:
backend : pro
`
` huseyin-MacBook-Pro:city huseyinsolmaz$ sudo ionic cordova build --release android
cordova platform add android --save Using cordova-fetch for cordova-android@7.0.0
Adding android project…
Creating Cordova project for the Android platform:
Path: platforms/android
Package: io.ionic.starter
Name: city
Activity: MainActivity
Android target: android-26
Subproject Path: CordovaLib Subproject Path: app Android project created with cordova-android@7.0.0
Android Studio project detected
Android Studio project detected
Discovered plugin “cordova-plugin-whitelist” in config.xml. Adding it to the project
Installing “cordova-plugin-whitelist” for android
This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
Adding cordova-plugin-whitelist to package.json Saved plugin info for “cordova-plugin-whitelist” to config.xml
Discovered plugin “cordova-plugin-device” in config.xml. Adding it to the project
Installing “cordova-plugin-device” for android
Adding cordova-plugin-device to package.json
Saved plugin info for “cordova-plugin-device” to config.xml
Discovered plugin “cordova-plugin-splashscreen” in config.xml. Adding it to the project
Installing “cordova-plugin-splashscreen” for android
Adding cordova-plugin-splashscreen to package.json
Saved plugin info for “cordova-plugin-splashscreen” to config.xml
Discovered plugin “cordova-plugin-ionic-webview” in config.xml. Adding it to the project
Installing “cordova-plugin-ionic-webview” for android
Adding cordova-plugin-ionic-webview to package.json
Saved plugin info for “cordova-plugin-ionic-webview” to config.xml
Discovered plugin “cordova-plugin-ionic-keyboard” in config.xml. Adding it to the project
Installing “cordova-plugin-ionic-keyboard” for android
Adding cordova-plugin-ionic-keyboard to package.json
Saved plugin info for “cordova-plugin-ionic-keyboard” to config.xml
Running command: /Users/huseyinsolmaz/Sites/city/hooks/after_prepare/010_add_platform_class.js /Users/huseyinsolmaz/Sites/city
–save flag or autosave detected
Saving android@~7.0.0 into config.xml file …
cordova build android --release Android Studio project detected
Running command: /Users/huseyinsolmaz/Sites/city/hooks/after_prepare/010_add_platform_class.js /Users/huseyinsolmaz/Sites/city
ANDROID_HOME=/usr/local/Caskroom/android-sdk/3859397 JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home (node:13133) UnhandledPromiseRejectionWarning: CordovaError: Requirements check failed for JDK 1.8 or greater at /Users/huseyinsolmaz/Sites/city/platforms/android/cordova/lib/check_reqs.js:370:19 at _fulfilled (/Users/huseyinsolmaz/Sites/city/platforms/android/cordova/node_modules/q/q.js:854:54) at self.promiseDispatch.done (/Users/huseyinsolmaz/Sites/city/platforms/android/cordova/node_modules/q/q.js:883:30) at Promise.promise.promiseDispatch (/Users/huseyinsolmaz/Sites/city/platforms/android/cordova/node_modules/q/q.js:816:13) at /Users/huseyinsolmaz/Sites/city/platforms/android/cordova/node_modules/q/q.js:624:44 at runSingle (/Users/huseyinsolmaz/Sites/city/platforms/android/cordova/node_modules/q/q.js:137:13) at flush (/Users/huseyinsolmaz/Sites/city/platforms/android/cordova/node_modules/q/q.js:125:13) at _combinedTickCallback (internal/process/next_tick.js:131:7) at process._tickCallback (internal/process/next_tick.js:180:9) (node:13133) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:13133) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
`
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:23 (7 by maintainers)
Top GitHub Comments
1.Remove all the Java related packages (Sun, Oracle, OpenJDK, IcedTea plugins, GIJ):
2.Purge config files (careful. This command removed libsgutils2-2 and virtualbox config files too):
3.Remove Java config and cache directory:
4.Remove manually installed JVMs:
5.Remove Java entries, if there is still any, from the alternatives:
6.Search for possible remaining Java directories:
7.Install JAVA-8-SDK
8.Open sudo gedit ~/.bashrc and add these lines
Try to run your ionic app again 😃 Njoy!
*** IF YOU GET THIS ERROR ***
This error occurs when building Android projects for Cordova with Java 10. Cordova Android projects still require Java 8. The instructions for installing Java are different per OS.
Here are Cordova’s official instructions: https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#java-development-kit-jdk
There are also plenty of online resources for installing Java 8. Just google something like
"install java 8 mac os"