Search code examples
java.netinstallationjava-11maui

Java SDK 11.0 or above is required when using .NET 6 or higher


I've installed .NET 6 (version 6.0.100-rc.1.21458.32) and Visual Studio 2020 Preview (although it might be not a prerequisite).

I am trying to debug a hello-world application but I am getting a build error regarding Java.

C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\31.0.100-rc.1.12\targets\Microsoft.Android.Sdk.Tooling.targets(20,5): error XA0031: 
Java SDK 11.0 or above is required when using .NET 6 or higher. 

I've installed Java 17 setting Path as well as pointing to the Java Development Kit Location in Visual Studio settings (tools->options->Xamarin->Android Settings). Because that didn't work I've set the JDK location to Microsoft's openjdk, but it still doesn't work.

enter image description here

What's wrong here?


Solution

  • Installing Microsoft's OpenJDK 11 did the job for me.

    You may notice that Visual Studio installs a version of Microsoft OpenJDK, however, you need to install the Microsoft OpenJDK 11