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).
| | |
| | | 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)); |
| | |
| | | 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; |
| | |
| | | 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 = |