I am working on a project where I need to compile and execute a Haskell file over cmd which I start/control with Java. That is what it looks like now:
public class CmdTest {
public static void main(String[] args) throws Exception {
ProcessBuilder builder = new ProcessBuilder( "cmd.exe", "/c", "cd \"C:\\Users\\ray\\Documents\\Project\" && ghci ", "test.hs");
builder.redirectErrorStream(true);
Process p = builder.start();
BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line;
while (true) {
line = r.readLine();
if (line == null) { break; }
System.out.println(line);
}
}
}
So far so good. Then i tried to execute my actual haskell-function(testfunction) by writing it directly behind the "test.hs" and i tried to write "..."test.hs", "testfunction 2");" and many more way, but i cant load it, when i add any of those. Please tell me how i can fix it and get it running. Thx for your time
Ray