mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
30.26.2007 739ae3927ffd599808ea70a386452cbb148de52d
Partial fix for Issue 2026: installer should ensure 1.5 or later JAVA_HOME setting.
Force the processes launched by the installer and the upgrader to use the same JVM as the tools (th
is is done by setting the JAVA_HOME environment variable when creating the processes).

2 files modified
13 ■■■■■ changed files
opends/src/quicksetup/org/opends/quicksetup/BuildInformation.java 6 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/util/ExternalTools.java 7 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/BuildInformation.java
@@ -93,6 +93,12 @@
    ProcessBuilder pb = new ProcessBuilder(args);
    InputStream is = null;
    try {
      Map<String, String> env = pb.environment();
      env.put("JAVA_HOME", System.getProperty("java.home"));
      /* Remove JAVA_BIN to be sure that we use the JVM running the
       * uninstaller JVM to run the command.
       */
      env.remove("JAVA_BIN");
      Process process = pb.start();
      is = process.getInputStream();
      BufferedReader reader = new BufferedReader(new InputStreamReader(is));
opends/src/quicksetup/org/opends/quicksetup/util/ExternalTools.java
@@ -33,6 +33,7 @@
import java.util.logging.Level;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.io.IOException;
import java.io.BufferedReader;
@@ -110,6 +111,12 @@
    LOG.log(Level.INFO, "Invoking " + Utils.listToString(args, " "));
    ProcessBuilder pb = new ProcessBuilder(args);
    Map<String, String> env = pb.environment();
    env.put("JAVA_HOME", System.getProperty("java.home"));
    /* Remove JAVA_BIN to be sure that we use the JVM running the
     * uninstaller JVM to run the command.
     */
    env.remove("JAVA_BIN");
    Process p = pb.start();
    BufferedReader out =