[Windows] check %JAVA_HOME% for locating Jdk #74
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: http://feedback.devdiv.io/606218
Something has happened with Xamarin.Android builds running on Azure
DevOps recently, builds are now failing with:
Azure DevOps has posted a "workaround" document:
https://github.com/microsoft/azure-pipelines-image-generation/blob/1371aa8548aa135c3be783bd854681118ca10f78/images/win/Vs2019-Server2019-Readme.md#known-issues
It suggests adding this property to MSBuild calls:
Reviewing a user's build log from ReactiveUI:
https://dev.azure.com/dotnet/ReactiveUI/_build/results?buildId=18505
So I tried this with my own repo that has Azure DevOps configured,
sure enough a build from June 18, 2019 worked. A rebuild on July 1,
2019 failed with the reported error.
I can read from the build logs that both
JAVA_HOMEandJAVA_HOME_8_X64are set to:I think this means two things:
Hosted Windows 2019 with VS2019pool.https://docs.microsoft.com/en-us/java/azure/jdk/java-jdk-install?view=azure-java-stable
I think we should add a "last resort" lookup for a valid JDK within
JAVA_HOMEon Windows. It does not currently do that.Reviewing the code, I am somewhat confused by
JdkInfo. Its logic isnot run on Windows, and instead we have Windows-specific JDK lookups
in
AndroidSdkWindows. To make things work properly we can just add alast chance lookup for
JAVA_HOMEinAndroidSdkWindows.I also cleaned up the tests a bit:
CreateFauxJavaSdkDirectorywasnot setting up
jar.exeorjvm.dll.