8261920: [AIX] jshell command throws java.io.IOError on non English locales

Reviewed-by: stuefe
This commit is contained in:
Ichiroh Takiguchi 2021-02-24 13:13:57 +00:00
parent 8c07063dae
commit 2c99bad082
2 changed files with 8 additions and 0 deletions

View File

@ -14,6 +14,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InterruptedIOException;
import java.io.OutputStream;
import java.util.Map;
import java.util.Objects;
/**
@ -29,6 +30,12 @@ public final class ExecHelper {
try {
Log.trace("Running: ", cmd);
ProcessBuilder pb = new ProcessBuilder(cmd);
if (OSUtils.IS_AIX) {
Map<String,String> env = pb.environment();
env.put("PATH", "/opt/freeware/bin:" + env.get("PATH"));
env.put("LANG", "C");
env.put("LC_ALL", "C");
}
if (redirectInput) {
pb.redirectInput(ProcessBuilder.Redirect.INHERIT);
}

View File

@ -32,6 +32,7 @@ public class OSUtils {
&& System.getenv("ConEmuPID") != null;
public static final boolean IS_OSX = System.getProperty("os.name").toLowerCase().contains("mac");
public static final boolean IS_AIX = System.getProperty("os.name").equals("AIX");
public static String TTY_COMMAND;
public static String STTY_COMMAND;