Delen via


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

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). Alternately, you can install the Microsoft Mobile OpenJDK Preview. The Microsoft Mobile OpenJDK will eventually replace JDK 8 for Xamarin.Android development.

To update to the Microsoft Mobile OpenJDK, see Microsoft Mobile OpenJDK Preview. To update to JDK 8, follow these steps:

  1. Download JDK 8 (1.8) from the Oracle website:

    Screenshot of the JDK download page on the Oracle website

  2. 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

  3. Run the .exe and install the Development Tools:

    Installing the Development Tools in the JDK installer

  4. 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:

    Path setting for the JDK in the Android Settings page

Be sure to restart Visual Studio after updating the location.