# Environmental Variables
Regardless of the Operating System, Environmental variables are used by the OS to store important things like the location of installed programs.
These variables are used by the build process for Android, iOS and our Cordova apps.
Official Reference for Android Environmental Variables (opens new window)
# Windows
When updating Environmental Variables on Windows you need to go to the system settings to add new variables or to edit the values in the PATH variable. Depending on which version of Windows you might have to edit a long string for the PATH, with semi-colons between each value, or you might get a list of values that can be edited or removed.
The variables we should create to use with Cordova are:
ANDROID_HOME - the location of the Android SDK folder
ANDROID_SDK_ROOT - the location of the Android SDK folder
JAVA_HOME - The location of the JDK to use with Android.
STUDIO_JDK - The location of the JDK to use with Android.
GRADLE_HOME - The location of the current Gradle version folder
2
3
4
5
6
7
If you placed your Gradle files inside the extras
folder, as detailed on the week 11 home page, then you can use the %ANDROID_HOME%
variable as part of your path.
Here is an example:
GRADLE_HOME %ANDROID_HOME%\gradle-6.0.1\gradle
In the PATH
variable we need to include the locations for these folders. The folders are all inside of ANDROID_HOME, except for the bin
folders which are inside JAVA_HOME and ANDROID_HOME.
%JAVA_HOME%\bin
%GRADLE_HOME%\bin
%ANDROID_HOME%\emulator
%ANDROID_HOME%\tools/bin
%ANDROID_HOME%\tools
%ANDROID_HOME%\platform-tools
%ANDROID_HOME%\build-tools - this is for older config versions.
2
3
4
5
6
7