Skip to content

Commit 25987c9

Browse files
dellis1972jonpryor
authored andcommitted
Look for JDK 1.8 before JDK 1.6 (#1)
Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=52928 The order of the default JDK search was incorrect. We should be searching for the latest JDK first since this is what the google tooling needs. This commit switches the order in which we do the search.
1 parent aaaa9eb commit 25987c9

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/Xamarin.Android.Tools.AndroidSdk/Sdks/AndroidSdkWindows.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,14 @@ protected override string GetJavaSdkPath ()
114114
Logger (TraceLevel.Info, $" Key {key_name} found.");
115115

116116
// No matter what the CurrentVersion is, look for 1.6 or 1.7 or 1.8
117-
if (CheckRegistryKeyForExecutable (RegistryEx.LocalMachine, subkey + "\\" + "1.6", "JavaHome", wow64, "bin", JarSigner))
118-
return RegistryEx.GetValueString (RegistryEx.LocalMachine, subkey + "\\" + "1.6", "JavaHome", wow64);
117+
if (CheckRegistryKeyForExecutable (RegistryEx.LocalMachine, subkey + "\\" + "1.8", "JavaHome", wow64, "bin", JarSigner))
118+
return RegistryEx.GetValueString (RegistryEx.LocalMachine, subkey + "\\" + "1.8", "JavaHome", wow64);
119119

120120
if (CheckRegistryKeyForExecutable (RegistryEx.LocalMachine, subkey + "\\" + "1.7", "JavaHome", wow64, "bin", JarSigner))
121121
return RegistryEx.GetValueString (RegistryEx.LocalMachine, subkey + "\\" + "1.7", "JavaHome", wow64);
122122

123-
if (CheckRegistryKeyForExecutable (RegistryEx.LocalMachine, subkey + "\\" + "1.8", "JavaHome", wow64, "bin", JarSigner))
124-
return RegistryEx.GetValueString (RegistryEx.LocalMachine, subkey + "\\" + "1.8", "JavaHome", wow64);
123+
if (CheckRegistryKeyForExecutable (RegistryEx.LocalMachine, subkey + "\\" + "1.6", "JavaHome", wow64, "bin", JarSigner))
124+
return RegistryEx.GetValueString (RegistryEx.LocalMachine, subkey + "\\" + "1.6", "JavaHome", wow64);
125125
}
126126

127127
Logger (TraceLevel.Info, $" Key {key_name} not found.");

0 commit comments

Comments
 (0)