Before we can even begin to work with the Android SDK, we need to make sure that we have the latest Java Development Kit (JDK) installed. It is more than likely that you have this already, but if you are unsure, type
java -version at the command line, and hopefully you will see something like this:
Note that Android 5 requires Java 1.7 or higher.
If you only have the Java Runtime Environment (JRE), you can download the JDK from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html. You will also need to take a note of where the JDK is installed ...