diff --git a/build/dependencies/setupJdk.gradle b/build/dependencies/setupJdk.gradle index aa446c04fa36..8736f2627f21 100644 --- a/build/dependencies/setupJdk.gradle +++ b/build/dependencies/setupJdk.gradle @@ -26,7 +26,7 @@ project.ext.targetOs = "${System.getProperty("intellij.build.target.os", "all")} task downloadJdk18 { def os = org.gradle.internal.os.OperatingSystem.current() - def arch = !os.isWindows() || !os.nativePrefix.endsWith('x86') ? 'x64' : 'x86' + def arch = !os.isWindows() || System.getenv("ProgramFiles(x86)") != null ? 'x64' : 'x86' def platform = currentPlatformName() def artifactName = "jbsdk8${jdkBuild}_${platform}_${arch}.tar.gz" @@ -132,7 +132,7 @@ def intellijProjectDir() { static def jdk16Version() { def os = org.gradle.internal.os.OperatingSystem.current() if (os.isWindows()) { - def suffix = os.nativePrefix.endsWith('x86') ? "i586" : "x64" + def suffix = System.getenv("ProgramFiles(x86)") != null ? "x64" : "i586" return "6.45:windows_$suffix" } else if (os.isMacOsX()) { diff --git a/build/scripts/unpackJdks.gant b/build/scripts/unpackJdks.gant index f1a3c9486da0..d938fcc6b960 100644 --- a/build/scripts/unpackJdks.gant +++ b/build/scripts/unpackJdks.gant @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import org.apache.tools.ant.BuildException target(default: "Unpack JDKs") { def workingDirectory = getDependenciesProjectDir() @@ -24,7 +25,7 @@ target(default: "Unpack JDKs") { process.consumeProcessErrorStream((OutputStream)System.err) process.waitFor() if (process.exitValue() != 0) { - projectBuilder.error("Cannot unpack JDK") + throw new BuildException("Cannot unpack JDK") } }