summaryrefslogtreecommitdiff
path: root/share/qbs/modules/java/utils.js
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@petroules.com>2015-07-08 03:07:00 -0700
committerJake Petroules <jake.petroules@petroules.com>2015-07-09 08:24:27 +0000
commit6ba69981dd8218f42f74ec57577f756438691064 (patch)
treeb8b3a7d94a16e6fc1ddb66fb70f7315aaaec5202 /share/qbs/modules/java/utils.js
parent074bf27f29eec1359e4669d3bbfa01dd6419841c (diff)
downloadqbs-6ba69981dd8218f42f74ec57577f756438691064.tar.gz
Fix JDK detection when using the Android module.
Don't pass "--arch undefined" if no architecture is set. Change-Id: Ibbb817f99d259e151bbe6142b207ee118aeba0b3 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Diffstat (limited to 'share/qbs/modules/java/utils.js')
-rw-r--r--share/qbs/modules/java/utils.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/share/qbs/modules/java/utils.js b/share/qbs/modules/java/utils.js
index 9eab02fa8..4c91c0e44 100644
--- a/share/qbs/modules/java/utils.js
+++ b/share/qbs/modules/java/utils.js
@@ -61,11 +61,14 @@ function findJdkPath(hostOS, arch) {
if (hostOS.contains("osx")) {
var p = new Process();
try {
- arch = arch === "x86" ? "i386" : arch;
-
// We filter by architecture here so that we'll get a compatible JVM for JNI use.
- // --failfast doesn't print the default JVM if nothing matches the filter.
- p.exec("/usr/libexec/java_home", ["--arch", arch, "--failfast"]);
+ var args = [];
+ if (arch) {
+ args.push("--arch", arch === "x86" ? "i386" : arch);
+ }
+
+ // --failfast doesn't print the default JVM if nothing matches the filter(s).
+ p.exec("/usr/libexec/java_home", args.concat(["--failfast"]), true);
return p.readStdOut().trim();
} catch (e) {
return undefined;