From 6572b5782078d27575e5023391aa68bcba464923 Mon Sep 17 00:00:00 2001 From: William Whittle Date: Tue, 5 Sep 2017 20:06:56 +0100 Subject: [PATCH] Use the linux64 platform when run on 64-bit Linux. This allows the use of launch4j plugin when run on a 64-bit Linux with no 32-bit support, such as Windows Subsystem for Linux. --- .../akathist/maven/plugins/launch4j/Launch4jMojo.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/akathist/maven/plugins/launch4j/Launch4jMojo.java b/src/main/java/com/akathist/maven/plugins/launch4j/Launch4jMojo.java index d3e4da2..a4afb8c 100644 --- a/src/main/java/com/akathist/maven/plugins/launch4j/Launch4jMojo.java +++ b/src/main/java/com/akathist/maven/plugins/launch4j/Launch4jMojo.java @@ -586,14 +586,21 @@ private void retrieveBinaryBits(Artifact a) throws MojoExecutionException { private Artifact chooseBinaryBits() throws MojoExecutionException { String plat; String os = System.getProperty("os.name"); + String arch = System.getProperty("os.arch"); getLog().debug("OS = " + os); + getLog().debug("Architecture = " + arch); // See here for possible values of os.name: // http://lopica.sourceforge.net/os.html if (os.startsWith("Windows")) { plat = "win32"; } else if ("Linux".equals(os)) { - plat = "linux"; + if ("amd64".equals(arch)) { + plat = "linux64"; + } + else { + plat = "linux"; + } } else if ("Solaris".equals(os) || "SunOS".equals(os)) { plat = "solaris"; } else if ("Mac OS X".equals(os) || "Darwin".equals(os)) {