Why does Visual Studio Professional 2022 fail to install OpenJDK v8 during .NET MAUI setup?
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:
- 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.
- 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.
- 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.
- 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?