I want to run SWI-Prolog from Java file. I want to read text.pl file and write the output in output.txt file. How can I do that? I'm not pretty sure of what I did here if it is correct or not. I'm not familiar with the command line calling. This is the Java code:
public class Example
{
public static void main(String[] args)
{
SystemCommandsRunner scr = new SystemCommandsRunner();
scr.runCommand("swipl -f input.pl < input.pl > output.txt");
}
}