I am trying to run linux sort from Java. but it's not working.
Process p1 = Runtime.getRuntime().exec("/bin/sort -k5,5 -k1,1n in.txt > out.txt");
int exitV = p1.waitFor();
The out.txt never get generated. and exitV always return 2.
I run the command in Linux, works fine.
I run Process p1 = Runtime.getRuntime().exec("/bin/touch out.txt"); works fine. so has nothing to do with write permission.
I've been struggle for a whole. please help!