in Java 8, windows 10, i have a text app, i want to open a console and write something there,
first try is:
String [] cmd = {"cmd.exe", "/c", "start"};
ProcessBuilder f = new ProcessBuilder(cmd);
f.redirectErrorStream(true);
Process p = f.start();
PrintStream printStream=new PrintStream(p.getOutputStream());
//
System.setOut(printStream);
System.out.println("this write in CMD"); //did not work
second try is:
printStream.println("this write in CMD");//did not work
Can any body Help?