Skip to content

Commit

Permalink
8261920: [AIX] jshell command throws java.io.IOError on non English l…
Browse files Browse the repository at this point in the history
…ocales

Reviewed-by: stuefe
  • Loading branch information
Ichiroh Takiguchi committed Feb 24, 2021
1 parent 8c07063 commit 2c99bad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Expand Up @@ -14,6 +14,7 @@
import java.io.InputStream;
import java.io.InterruptedIOException;
import java.io.OutputStream;
import java.util.Map;
import java.util.Objects;

/**
Expand All @@ -29,6 +30,12 @@ public static String exec(boolean redirectInput, final String... cmd) throws IOE
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);
}
Expand Down
Expand Up @@ -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;
Expand Down

1 comment on commit 2c99bad

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.