<p>Fixed it by adding a Java Tool Installer step before the dotnet build step, to use Java 11 explicitly</p>
<p><a href="https://i.sstatic.net/wuqYD.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/wuqYD.png" alt="enter image description here" /></a></p>
<p>Settings:</p>
<p><a href="https://i.sstatic.net/sfFTN.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/sfFTN.png" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2023-11-20T16:44:06.043Z
2023-11-20T16:44:06.043Z
James McCormack
<p>We have an existing Azure DevOps build pipeline that was working fine until today, 20th November 2023.
We have noticed that the previous successful build was using MSBuild version 17.7.3.
Today it's using 17.8.3 that I assume means it is on a server with the new VS image on it.</p>
<pre><code>MSBuild version 17.8.3+195e7f5a3 for .NET
Build FAILED.
C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.95\targets\Microsoft.Android.Sdk.Tooling.targets(20,5): error XA0031: Java SDK 11.0 or above is required when using .NET 6 or higher. Download the latest JDK at: https://aka.ms/msopenjdk`
</code></pre>
<p>Looks like this is a breaking change for Xamarin / MAUI builds in the latest VS version (.NET 8 official, although our project is .NET 7). Any ideas how to fix it?</p>

<azure-devops><dotnet>
MAUI build failing with "Microsoft.Android.Sdk.Tooling.targets(20,5): error XA0031: Java SDK 11.0 or above is required when using .NET 6 or higher"
James McCormack
# MAUI build failing with "Microsoft.Android.Sdk.Tooling.targets(20,5): error XA0031: Java SDK 11.0 or above is required when using .NET 6 or higher"

(Asked by: username_0 on 2023-11-20)

We have an existing Azure DevOps build pipeline that was working fine until today, 20th November 2023.
We have noticed that the previous successful build was using MSBuild version 17.7.3.
Today it's using 17.8.3 that I assume means it is on a server with the new VS image on it.
MSBuild version 17.8.3+195e7f5a3 for .NET
Build FAILED.
C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\33.0.95\targets\Microsoft.Android.Sdk.Tooling.targets(20,5): error XA0031: Java SDK 11.0 or above is required when using .NET 6 or higher. Download the latest JDK at: https://aka.ms/msopenjdk`

Looks like this is a breaking change for Xamarin / MAUI builds in the latest VS version (.NET 8 official, although our project is .NET 7). Any ideas how to fix it?

**Tags:** azure-devops, dotnet


---

## 1 answers

### Answer by username_0 on 2023-11-20. Score: 0

Fixed it by adding a Java Tool Installer step before the dotnet build step, to use Java 11 explicitly

[![enter image description here](https://i.sstatic.net/wuqYD.png)](https://i.sstatic.net/wuqYD.png)

Settings:

[![enter image description here](https://i.sstatic.net/sfFTN.png)](https://i.sstatic.net/sfFTN.png)


---

