For some reason, this produces no output, even if there are java files in the current directory. If I remove the argument "*.java", then I will get output such as:
ProcessBuilder pb = new ProcessBuilder("ls", "*.java"); Process ps = pb.start(); Scanner in = new Scanner(ps.getInputStream()); while(in.hasNextLine()) System.out.println(in.nextLine()); // produces no output
However, executing sh -c ls *.java doesn't actually filter the listingsThat's not correct.
so everything is outputted whether it matches the pattern or not.Nor that.
I suppose I can handle the it though, somehow else.It should work as expected. If it doesn't you have done it wrong.