From 6041d2e02438bf291ed200c130eb50fc3db6a557 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Fri, 12 Aug 2016 16:07:54 -0400 Subject: [PATCH] sometimes StringList is a beautiful thing --- java/src/processing/mode/java/JavaBuild.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/java/src/processing/mode/java/JavaBuild.java b/java/src/processing/mode/java/JavaBuild.java index 14a5e6dc9..e0163f65e 100755 --- a/java/src/processing/mode/java/JavaBuild.java +++ b/java/src/processing/mode/java/JavaBuild.java @@ -1101,33 +1101,33 @@ public class JavaBuild { /// figure out run options for the VM - List runOptions = new ArrayList(); + StringList runOptions = new StringList(); // Set memory options, except for ARM where we're more memory-constrained // compared to the machine being used to build/export the sketch // https://github.com/processing/processing/pull/4406 if (Preferences.getBoolean("run.options.memory") && !exportVariant.equals("armv6hf")) { - runOptions.add("-Xms" + Preferences.get("run.options.memory.initial") + "m"); - runOptions.add("-Xmx" + Preferences.get("run.options.memory.maximum") + "m"); + runOptions.append("-Xms" + Preferences.get("run.options.memory.initial") + "m"); + runOptions.append("-Xmx" + Preferences.get("run.options.memory.maximum") + "m"); } // https://github.com/processing/processing/issues/2239 - runOptions.add("-Djna.nosys=true"); + runOptions.append("-Djna.nosys=true"); // https://github.com/processing/processing/issues/4608 if (embedJava) { // if people don't embed Java, it might be a mess, but what can we do if (exportPlatform == PConstants.MACOSX) { - runOptions.add("-Djava.ext.dirs=$APP_ROOT/Contents/PlugIns/jdk" + PApplet.javaVersionName + ".jdk/Contents/Home/jre/lib/ext"); + runOptions.append("-Djava.ext.dirs=$APP_ROOT/Contents/PlugIns/jdk" + PApplet.javaVersionName + ".jdk/Contents/Home/jre/lib/ext"); } else if (exportPlatform == PConstants.WINDOWS) { - runOptions.add("-Djava.ext.dirs=%EXEDIR%/java/lib/ext"); + runOptions.append("-Djava.ext.dirs=%EXEDIR%/java/lib/ext"); } else if (exportPlatform == PConstants.LINUX) { - runOptions.add("-Djava.ext.dirs=$APPDIR/java/lib/ext"); + runOptions.append("-Djava.ext.dirs=$APPDIR/java/lib/ext"); } } // https://github.com/processing/processing/issues/2559 if (exportPlatform == PConstants.WINDOWS) { - runOptions.add("-Djava.library.path=\"%EXEDIR%\\lib\""); + runOptions.append("-Djava.library.path=\"%EXEDIR%\\lib\""); } @@ -1286,8 +1286,7 @@ public class JavaBuild { // https://github.com/processing/processing/issues/2349 pw.print("$APPDIR/java/bin/"); } - String runOptionsStr = - PApplet.join(runOptions.toArray(new String[0]), " "); + String runOptionsStr = runOptions.join(" "); pw.print("java " + runOptionsStr + " -Djava.library.path=\"$APPDIR:$APPDIR/lib\"" + " -cp \"" + exportClassPath + "\"" +