我正在使用此方法创建一个控制台
MessageConsole console = new MessageConsole("", null);
console.activate();
ConsolePlugin.getDefault().getConsoleManager()
.addConsoles(new IConsole[] { console });
MessageConsoleStream stream = console.newMessageStream();
System.setOut(new PrintStream(stream, true));
我尝试了用于输入的常规方法,但它不起作用这是我试过的代码
[1]这会打印'输入字符串',但不允许您在控制台中写入
Scanner in = new Scanner(System.in);
System.out.println("Enter a string");
String s = in.nextLine();
System.out.println("You entered string " + s);
[2]并且打印为空
BufferedReader columnInput = new BufferedReader(new InputStreamReader(
System.in));
try {
System.out.println(columnInput.readLine());
// System.out.println("#read mflkerf: " );
} catch (IOException e) {
}