title: How would I update my ANDROID_SDK_ROOT / JAVA_HOME / PATH environment variables on a MAC to build Android
body: <p>I'm building an Ionic Cordova cross platform app.  When i run ionic cordova build android I get the following error.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>cordova-android-support-gradle-release: Android platform: V7+
  cordova-plugin-androidx-adapter: Processed 65 source files in 1452ms
  Checking Java JDK and Android SDK versions
  ANDROID_SDK_ROOT=undefined (recommended setting)
  ANDROID_HOME=/Users/anonymous/Library/Android/sdk (DEPRECATED)
  Requirements check failed for JDK 8 ('1.8.*')! Detected version: 15.0.1
  Check your ANDROID_SDK_ROOT / JAVA_HOME / PATH environment variables.
  [ERROR] An error occurred while running subprocess cordova.</code></pre>
  </div>
  </div>
  </p>
  <p>Here is my java version:</p>
  <p>java version &quot;15.0.1&quot; 2020-10-20
  Java(TM) SE Runtime Environment (build 15.0.1+9-18)
  Java HotSpot(TM) 64-Bit Server VM (build 15.0.1+9-18, mixed mode, sharing)</p>
  <p>Everything was working until I downloaded the latest Java SDK, now I can't build Android.</p>
  <p>I read in another Stack post that this is bad:
  java version &quot;15.0.1&quot; 2020-10-20
  Java(TM) SE Runtime Environment (build 15.0.1+9-18)
  Java HotSpot(TM) 64-Bit Server VM (build 15.0.1+9-18, mixed mode, sharing)</p>
  <p>I'm not really sure how to resolve this and why the Java SDK doesn't appear when I check Java -version.</p>
  <p>I set this in my .bash_profile
  ANDROID_HOME=/Users/anonymous/Library/Android/sdk
  ANDROID_SDK_ROOT=~/Library/Android/sdk</p>