I’m currently working on learning how to develop apps for the ever-popular Android ecosystem! As fun as it is, one of the biggest headaches for any developer is actually (you guessed it!) setting up your development environment. This post will detail a pretty simple, yet easy to make mistake with installing the required tools for Android development.
As this post states, the first thing you’ll need to get started is the Java jdk! Android is Java based (All the apps run in JVM’s), so it’s one of the necessary components to developing native apps for it. Finding and installing it is pretty easy; you can simply head to Oracle’s website to do that…right?
Yes! But be wary!
At the time of this post, Android supports Java SE 7, and the latest version out and about right now is Java 8. If you were to install Java SE 8, you’d run into some configuration issues when you’re ready to install your IDE. One other thing to note is that Oracle doesn’t make it particularly easy to find Java SE 7 on their website, you’ll have to navigate your way to the “Archives” section, so I’ve gone ahead and left that link here (just because I care for you that much). To be sure, once you select the Java SE 7 link, you want to download the “Java SE Development Kit 7u80”.
Double Check Your Environment Variables
Once you’ve installed the right version of Java, a safe way to make sure the IDE you’ll be using will see it is by opening up your Command Prompt and typing “java – version”. If the response to your command looks like this:
This means that your path to the Java directory isn’t set. It’s fine; all is not lost. You can set that path by heading over to the directory you installed Java in (by default, it’s usually in the “Program Files” folder), navigating to the “bin” folder in the “jdk 1.7.0_80” folder, and copying the address (including the “bin” folder). For example, mine looks like this: C:\Program Files\Java\jdk1.7.0_80\bin
From there, head over to the Control Panel. In the search bar, type “environment variables” and select “Edit the system environment variables” After the dialog box appears, click the “Environment Variables…” button at the bottom. You should see two boxes, one for User variables, and one for System. Since we want the path to be set globally, we’ll find the “Path” variable in the “System variables” box and click “Edit.” Scroll all the way to the leftmost side of the “Variable value” field and paste your address in. As you can see from the picture below, I’ve already done so and your address should look similar.
Now, when we open the Command Prompt again and type “javac”, we get an slew of text delimiting proper usage of the command. It should look like this:
Woot! Now the OS knows where Java is living, and we’re off to step 2!