G’day, G’day, Tim Buchalka, the Aussie Android Dev Guy here with another video for all you Android lovers out there. Today’s topic, the Java Development Kit installation and configuration for the Mac. That’s right, if you’ve got a Mac, this video is for you.

So without further ado, let’s get into this video, Java Development Kit installation for the Mac.

The best way to get up to speed is to watch the video on this page.

If you click the youtube logo at the bottom right of the video you can watch this video on Youtube in the proper size.

click-the-youtube-logo

Checking If Java Is Installed

First step, we need to go through and have a look and see whether Java is on this machine. To do that, we’re going to go to ‘System Preferences…’ for the Mac. We’re looking for a Java icon at the bottom left hand corner below ‘Users & Groups’, of the System Preferences. The fact that there’s not one there, tells us the JDK version 7 or higher has not been installed on this Mac.

Installing the JDK and JRE

So what you also need to then is to open up ‘Terminal’ on your Mac. You want to do that by holding down ‘Command’ key and pressing the space bar. Then type the word ‘Terminal’ in the Spotlight Search and pressing [ENTER].

Once the Terminal has been opened type “java -version”. You will see an error message saying ‘No Java runtime present, requesting install. And if you click on ‘More Info…’ that’s going to give us the access or access to the site to download the Java JDK. You would actually want the Java JDK, so install that first by clicking on the Java Platform button on the left. Make sure your in the page, then scroll down and click on ‘Accept License Agreement’. Select the JDK Again, its JDK, not JRE. So, click on JDK for the Mac OS X and then leave that downloading.

checking-jdk-version-installed

 

Now, the thing is, if we go ahead and just install that, we’re going to have problems with Android Studio. Android Studio is going to complain and say it couldn’t find a JVM, and that’s because it’s looking for the standard Java version 6 that normally comes with OS X.

So, if you are running a version prior to Yosemite 10.10 OS X you won’t have a problem. But, if you are running ‘Yosemite’, you’ll find that won’t work. And that’s because Apple in their infinite wisdom have removed Java 6.

But, we can get around that, because there’s actually a link here http://support.apple.com/kb/DL1572, just go to that page and install the version of Java in that page. Now this is version 6. You see their package installs the same version of Java 6 included in Java, and it gives you the old version it used to be. This will be fine, this is what Android Studio needs to run itself. And, it will make more sense in the Android Studio video. The bottom line is, we need both of them.

So we need to install JRE(Java Runtime Edition) for version 6 first, then we need to install the JDK.

So to do that, I’m going to install the Java for OS X first, so open up the installer. Go ahead open up the installer for that. It’s only a runtime edition, so it’s much smaller, basically it’s only about 60 megs, and the JDK is was about 250 megs. So just go through and accept all the defaults and click on ‘Agree’. You must always agree to these installation terms and conditions(even if you don’t read them religiously). Then it will start installing the JRE, once installed close the setup window.

Next, we’re now going to install the JDK. Just to be sure, go back to System Preferences and make sure that a Java icon shouldn’t still be in there. That’s because we installed version 6. But we now need version 7 or higher. In this case we’re going to go to version 8 because that’s what was the latest download from the Oracle site. We are going to go through and install this and again this is the JDK and when we get to the Android Studio installation video it’ll be asking for a JDK version that is 7 or higher.

installing-jdk-on-the-mac

 

That’ll make more sense, so it’s a bit convoluted, the process here, especially for Yosemite. because they didn’t include Java by default. Ok, by this stage we’ve now got both versions of the Java JDK and the JRE installed. You can close the installers because we’re through with them.

Checking If Installed

So now if we go back to ‘System Preferences…’ we’ll see the Java menu icon in it. Click on that. Then just go into ‘General’, and click on ‘About…’ and you can see you’re now running version 8. So you’ve got the right version for Android Studio. But, you’ve also installed the version 6 that it needs for the runtime.

checking-jdk-version-installed

 

In terms of updates, it probably wouldn’t hurt to go through and click on update tab in the Java window to update it. Now, I’m not going to do that in this video just to save you some time. If you wanted to do that, that would be fine, but it will certainly work without it.

Conclusion

And, that’s a wrap. We’re now done and dusted. We’ve got our Java Development Kit installed and configured.

Please subscribe to my YouTube channel, to be able to keep up to date with the latest videos on app development for Android and games development as and when I release them.

Now speaking of content, please also leave some comments below the post. Let me know what you thought of the video, but also now perhaps more importantly what you’d like me to cover in future videos. Because I want to be the #1 premium resource for you for Android development tips, tricks, tutorials, and so forth.

But in order to do that, I need some feedback from you to know what you want me to cover in future videos, so please do that.

Tim’s Android Development Course

My course contains over Twenty-five (25)  hours of video training. With more being added regularly.
Teaching you, whether you’re a beginner at coding, or more experienced how to be a great Android app developer.  A fraction under 11,000  students have already taken my course and more are joining everyday.   I’d love to see you in there so come and check out what all the fuss is about!

Click here to access my Android Development course

 

All the best!

Cheers
Tim