Due to recent SDK updates, we now need to use Gradle 8.8 in Unity 2022.3, and consequently Java 17. We managed to set it up locally, and we are now trying to do the same in Unity Build Automation (UBA). However, we haven’t been able to change the Java version from 11 to 17.
We attempted to change the JAVA_HOME environment variable by all possible means, but it seems this does not affect how Gradle is launched.
In both the Windows and Mac build environments, we get the following:
CommandInvokationFailure: Gradle build failed.
/Library/Java/JavaVirtualMachines/jdk-11/Contents/Home/bin/java
CommandInvokationFailure: Gradle build failed.
C:\Program Files\Java\jdk1.11\bin\java.exe
To continue using Unity Build Automation (UBA), we need at least some way to run Gradle with Java 17 for Unity 2022.3.