1
votes

Help me please! I don't know what else to do ... I've read all the help that talks about it and so far I haven't been able to solve it!

Tiagos-iMac:app tiago$ cordova run android Checking Java JDK and Android SDK versions ANDROID_SDK_ROOT=/Users/tiago/Library/Android/ (recommended setting) ANDROID_HOME=/Users/tiago/Library/Android/ (DEPRECATED) Requirements check failed for JDK 8 ('1.8.*')! Detected version: 13.0.2 Check your ANDROID_SDK_ROOT / JAVA_HOME / PATH environment variables. Tiagos-iMac:app tiago$

How can I solve this? Please help!

.bash_profile

export JAVA_HOME=$(/usr/libexec/java_home)

PATH=$PATH:$HOME/Library/Android/Sdk/emulator
PATH=$PATH:$HOME/Library/Android/Sdk/tools
PATH=$PATH:$HOME/Library/Android/Sdk/tools/bin
PATH=$PATH:$HOME/Library/Android/Sdk/platform-tools
export ANDROID_SDK_ROOT=$HOME/Library/Android/


PATH=$PATH:$HOME/Library/Android/Sdk/emulator
PATH=$PATH:$HOME/Library/Android/Sdk/tools
PATH=$PATH:$HOME/Library/Android/Sdk/tools/bin
PATH=$PATH:$HOME/Library/Android/Sdk/platform-tools
export ANDROID_HOME=$HOME/Library/Android/

export ANDROID_AVD_HOME=~/.android/avd
export PATH=$PATH:/opt/gradle/gradle-6.1/bin

Java

Tiagos-iMac:~ tiago$ java -version
java version "13.0.2" 2020-01-14
Java(TM) SE Runtime Environment (build 13.0.2+8)
Java HotSpot(TM) 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)
Tiagos-iMac:~ tiago$ 
3

3 Answers

2
votes

Uninstall any previous Java versions, then install required JDK

1
votes

If you are on MacOSX Catalina^ use brew to install JENV to switch your java environment; and you are using Zsh you may need to run this command:

echo 'eval "$(jenv init -)"' >> ~/.zshrc

and restart your session (Terminal / Hyper etc.) and then try switching your java version, eg:

jenv global 1.8

You can then test that out with

java -version
0
votes

In my case, _JAVA_OPTIONS variable was set in the System Variables. Removing this fixed the issue.