For Mac Android Studio

Technical docs‎ > ‎Configuring Android Studio: IDE & VM Options, JDK, etc‎ > ‎

Mac OSX JDK Selection

Android Studio requires two different JDKs:

  • The version of Java that the IDE itself runs with.
  • The version of the JDK that it uses to get the Java compiler from
These two can be (and usually are) the same, but you can configure them individually. And on OSX in particular, they will often be different.

Project JDK

You can configure the JDK used for compiling your code in the Project Structure Dialog. This will be used to get a compiler to compile your code with. If you are building with compileSdkVersion 21 or later, you should use JDK 7 or JDK 8 here. You can also configure this path by editing the local.properties file in your project.

IDE JDK: Android Studio 2.2+

NOTE:
As of Android Studio 2.2, the IDE comes bundled with a custom OpenJDK build which contains a bunch of additional fixes to make the IDE work better (such as improved font rendering). If you've configured the IDE to use a custom JDK in the past, you should consider removing those configurations now and try the embedded JDK.

IDE JDK: Older versions

On Mac OSX, the version of Java used to run the IDE is generally chosen for you automatically, and the choice is based on an entry in the Info.plist file in the IDE installation. Please note: Do not edit Info.plist to pick a different version. That will break not only the application signature, but also future patch updates to your installation. Instead, you can pick a different JDK by setting the $STUDIO_JDK environment variable, as described in the IDE Configuration document.
On Mac OSX, the default version we are using to run the IDE (not to compile your code) is Java 6. This is primarily because the font rendering on Java 6 has full subpixel LCD antialiasing, whereas Java 7 and 8 does not.
Here's what some sample text looks like with Java 8:
And here's the IDE run with the same settings and Java 6 instead:

If you don't find the Java 6 version much more readable, you should use Java 8 instead, since it is more actively kept up to date. As described in the IDE Configuration document, you can run it like this:
$ open /Applications/Android Studio.app

(If you're curious about the difference: Java 6 performs rendering with Quartz, where in addition to slightly changing the colors, the fonts are rendered with subpixel LCD antialiasing. This might be the JDK bug tracking this: https://bugs.openjdk.java.net/browse/JDK-8023794).

Installing Java 6

If you double click on the Android Studio app bundle, Mac OSX should automatically pop up a dialog offering to install Java for you. If not, you can download it from this page:

Yosemite (Mac OSX 10.10) Issues

There are some reports about graphics glitches and other bugs specific to running Android Studio on Yosemite.
First, please make sure that you have the latest version of Java 6 installed; in some cases that has fixed the problems:

If not, try running a recent version of Java 7 or Java 8 instead by setting STUDIO_JDK as described above. That is reported to have fixed the other problems (though you will get the font rendering shown for Java 8 above.)

The Chrome OS is gaining in popularity but what if you want to try it out before splurging the cash on a Chromebook? Now you can try it out on Windows first with Android Studio.

The Chrome OS is gaining plaudits as more and more features are added. So it makes sense if you are curious and you want to give the system a spin. But since the Chrome OS is really only available on Chromebook laptops, you can’t really use Chrome OS on other operating systems. But there is a (sort of) workaround.

Using the free Android Studio, you can set up a virtual machine on Windows, MacOS and Linux computers, then run the Chrome OS inside it. You won’t get the complete Chrome OS experience on it but you will see enough to know whether or not the operating system is for you. The Chrome browser that comes with it is fully functional and you can sync all your browser settings to it.

Setting Up Chrome OS On Your Computer Using Android Studio

Android Studio For Mac OS is the most popular and powerful application which will allows to developers to write, debug, edit every android application effortlessly. Android Studio is used widely around the global.

When setting this up for the first time, there is some work involved. But Android Studio more or less holds your hand. When it doesn’t, well that’s what we’re here for.

Note you are going to need at least 3GB for the installation and another 2GB or so in RAM to make it go smoothly. So make sure you have those specs before you start. The virtual machine is going to take up a lot of memory (more than 50%) so shut down all other unnecessary programs first.

Download The Installation File

The first step is to go to Android Studio and download the installation program.

Install The First Part Of The Program

Now install it. This part is fairly straightforward. This however is only the first part of the installation, and the easiest part.

When this part of the installation is over, you will be asked if you have any settings and configurations from a previous installation. If so, you can import them in. If not, choose “Do not import settings” and click OK.

Run The Setup Wizard

Time to start up the wizard. You can choose things such as the color of your Chrome OS skin. I like the dark color but you can easily change it later if you decide you don’t like it.

Wait For The Next Part To Download & Install

It will then start downloading, unzipping and installing the rest of the necessary packages. This part took a while for me, so be patient. It helps if you shut down all unnecessary running programs, especially browsers. Mozenda for mac.

Eventually you will see this window.

Get Chrome OS From The SDK Manager

At the bottom left of that window, you will see a “Configure” option. Click that and choose “SDK Manager.” We are now going to choose our Android version and get Chrome OS.

After selecting “SDK Manager,” choose “SDK Update Sites” and click on the green “+” icon on the far right of the screen. A box will now come up. Under name, type “Chrome OS Repository.” In the URL field, type :

Click “Apply” then OK to save and close the box.

Now open a new box, and call it “Chrome OS System Images” and under URL, type :

Now switch to the SDK Tools tab and tick “Chrome OS device.”

When you click OK, the selected tools will be installed. Again, this might take a while as you are getting the Chrome OS file. When the installation has been done, restart Android Studio for the changes to kick in.

Create a New Android Project

Now it’s time to go back to the main Android Studio screen and create a new Android Project (assuming you haven’t imported in any previous project).

As you can see in the screenshot above, call your application “Chrome OS.” Under company domain, leave it alone. In my case, “mmpc” is the name of my hard drive, so let yours default to whatever name Android Studio gives you.

The project location will automatically default to where Android Studio is installed on your computer. Unless you have a good reason to change this location, leave it as it is.

Download

Now choose which “devices” you want to use Chrome OS on. To make things simple, just select “Phone and Tablet.” Of course you are free to choose others if you want.

Create a New Virtual Device

Now it is time to create the virtual device which you will run Chrome OS on. Click the AVD Manager icon on the next screen which is a pink rectangular icon.

Select “Tablet” on the left hand side and then “Pixelbook (beta)” from the main list.

Download & Install Your Preferred Android Version

The next screen will ask you to select and download your Android version. It makes sense to go with the latest version but if you want an earlier version, you can choose it and download it.

Now click “Finish” and installation is finished.

Switch On The Virtual Device & Log In With Your Google Account

The next screen is your Virtual Devices screen (you can make multiple virtual devices with different OS’s). On the right-hand side, you will see a green play button to start it up.

Once you click the play button, your newly minted Chrome OS will boot up. You will then be asked to log into your Google account and invited to sync your browser settings.

It is worth pointing out that you are going to experience some keys on your keyboard not working. Including, believe it or not, the @ key! So I recommend you set up a disposable email address just for trying out the Chrome OS. Give it a very simple password with no special characters. That way, you won’t blow your stack trying to log in with your 35 character complex password.