Why does Visual Studio Professional 2022 fail to install OpenJDK v8 during .NET MAUI setup?

Buzzdown 46 Reputation points
2024-09-04T10:19:16.8966667+00:00

I've been working on setting up Visual Studio for .NET MAUI development on my Windows computer, but I keep running into a problem during the setup process. The specific issue involves OpenJDK v8 failing to install. This is what I'm seeing:

Couldn't install OpenJDKv8

I've given a few things a shot to move past this, but nothing's worked yet. Here's a quick list of what I've already tried:

  1. Running the Installer as Admin: I ran the Visual Studio Installer with admin rights thinking it might fix a permissions problem. , this didn't work out.
  2. Manual Installation of OpenJDK: I got OpenJDK v8 from AdoptOpenJDK's website and set up the JAVA_HOME variable myself. Even though I could install it on my own, Visual Studio still can't install OpenJDK by itself.
  3. Checking Folder Permissions: I made sure the C:\Program Files\Android\jdk\ folder wasn't set to read-, and I checked that my account has full access. But I'm still stuck.
  4. Clearing the Installer Cache:: I wiped the Visual Studio Installer's cache by getting rid of everything in ProgramData\Microsoft\VisualStudio\Packages, but the install keeps failing.

This is the full error message I get during the installation:


Package 'OpenJDKv8,version=8.0.302.8,chip=x64' failed to install.
Return code: -2147024891
Return code details: Access to the path 'C:\Program Files\Android\jdk\jdk-8.0.302.8-hotspot\jdk8u302-b08\bin\klist.exe' is denied.

Has anyone ever experienced this? I wonder if there is a way to bypass the OpenJDK installation entirely through Visual Studio and just set it up manually for Android development in the MAUI. Or am I missing something simple?

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,118 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,500 questions
Visual Studio Setup
Visual Studio Setup
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
1,041 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.