Skip to content

Ghidra is a software reverse engineering (SRE) framework

Preventing Gradle from running with 32-bit Java (#972).

Ryan Kurtzff3362b5f38d
diff --git a/build.gradle b/build.gradle
index 948e1f164a..39fa4b7d4f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -24,6 +24,14 @@ if (System.env.JAVA_HOME) {
else {
project.ext.JAVA_HOME = "${System.properties.'java.home'}/../"
}
+
+/***************************************************************************************
+ * Make sure Gradle wasn't launched with a 32-bit Java...it can cause confusing errors
+ ***************************************************************************************/
+if ("32".equals(System.getProperty("sun.arch.data.model"))) {
+ throw new GradleException("\n\n\t32-bit Java detected! Please use 64-bit Java.\n\n");
+}
+
/*********************************************************************************
* Define the location of bin repo
*********************************************************************************/