How do I update the Java Development Kit (JDK) version?

PDF for offline use

Let us know how you feel about this

Translation Quality


0/250

last updated: 2017-06

This article illustrates how to update the Java Development Kit (JDK) version on Windows and Mac.

Overview

Xamarin.Android uses the Java Development Kit (JDK) to integrate with the Android SDK for building Android apps and running the Android designer. The latest versions of the Android SDK (API 24 and higher) require JDK 8 (1.8). If you have not yet updated to JDK 8, follow this guide to install and enable it.

Update the JDK on Windows

Download JDK 8 (1.8) from the Oracle website:

Screenshot of the JDK download page on the Oracle website

Pick the 64-bit version to allow rendering of custom controls in the Xamarin Android designer:

Selecting the Windows x64 JDK package to download from the JDK download page

Run the .exe and install the Development Tools:

Installing the Development Tools in the JDK installer

Open Visual Studio and update the Java Development Kit Location to point to the new JDK under Tools > Options > Xamarin > Android Settings > Java Development Kit Location > Change:

Path setting for the JDK in IDE Options Android Setting page

Be sure to restart Visual Studio after updating the location.

Update the JDK on Mac

Download JDK 8 (1.8) from the Oracle website:

Screenshot of the JDK download page on the Oracle website

Open the .dmg file and run the .pkg installer:

Running the JDK installer on macOS

Mac OS will automatically set the new JDK version as the default by updating /System/Library/Frameworks/JavaVM.framework/Versions/Current. You can then double-check that the Java SDK (JDK) location is set to the expected default of /usr under Xamarin Studio > Preferences > Projects > SDK Locations > Android > Java SDK (JDK) > Location:

Setting the JDK location in the Android SDK Location page

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.