Error for installation of JDK in Visual Studio 2017: Failed to download

This article helps you work around an error (failed to download) that occurs when you install Java Development Kit (JDK) in Microsoft Visual Studio 2017.

Original product version:   Visual Studio 2017
Original KB number:   4483430

Symptoms

When you install JDK in Visual Studio 2017, you receive one of the following error messages:

  • Message 1

    "Package 'JavaJDKV2,version=1.8.6,chip=x86' failed to download"

  • Message 2

    "Package 'JavaJDKV2,version=1.8.6,chip=x64' failed to download"

  • Message 3

    "ackage 'JavaJDKV1,version=1.8.18' failed to download"

  • Message 4

    "PackageId:JavaJDKV2;PackageAction:DownloadPackage"

Cause

This issue occurs because Oracle no longer allows distribution of JDK in Visual Studio (as of January 2019).

Workaround

To work around this issue, try the following methods:

  • We recommend updating to the latest version of Visual Studio 2017. The latest version of Visual Studio 2017 uses an OpenJDK distribution for mobile development and avoids setup issues that concern Oracle JDK.

  • If you can't update your Visual Studio, install the latest JDK 8 that's available from the Java SE Development Kit 8 Downloads. Then set the JDK path by following these steps:

    1. Select Tools.
    2. Select Options.
    3. Select Xamarin.
    4. Select Android Settings.

Third-party information disclaimer

The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, about the performance or reliability of these products.