I have an exe file, which I can run from cmd like this:
echo text|majka.exe -f majka.w-lt //or...
majka.exe -f majka.w-lt < text.txt //same, but reading text from file
I want to send this command from java. I know I can use ProcessBuilder like this:
String text = "text";
ProcessBuilder pb = new ProcessBuilder("C:\\majkawin\\majka.exe", "-f", "majka.w-lt");
pb.start();
but I don't know how to send String text by pipe to this command. I prefer solution without creating text.txt file if it is possible.