I am using the following code to run the cmd.exe and the cmd window appears which is fine.
Runtime runtime = Runtime.getRuntime();
try {
Process p = runtime.exec("cmd.exe /c start");
} catch (IOException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
My question is that how can I run the following command on the cmd before it appears using java
ghci test.hs
my target is to make the command line looks like the following image once it appears