0

I am developing in Ionic 4. I am using mac Mojave, and according to java -version, I am using 1.8.0_201, and $ JAVA_HOME also points to 1.8.0_201. However, when running ionic cordova run android, it gives me an android version error, because it indicates that I am using the JAVA_HOME of java 11.

Where is JAVA_HOME specified for ionic?

java -version
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

$JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home

Error ...

cordova build android --device Android Studio project detected ANDROID_HOME=/Users/antoniodelgado/Library/Android/sdk JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home studio

General Grievance
  • 4,555
  • 31
  • 31
  • 45
  • By any chance, did you change JAVA_HOME in one terminal and running `run android` in other terminal which was opened before changing the path? Try re-opening the terminal. – yashpatelyk Jul 27 '19 at 08:04
  • In all the terminals that I open I echo $ JAVA_HOME points to /Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home, but when I try to generate the apk, in the same terminal or another, it tells me ionic that the JAVA_HOME corresponds to jdk-11.0.2. – Antonio J. Delgado Castillo Jul 27 '19 at 08:15

0 Answers0