Create an executable file that copies stdin to stdout, or else a script that does so through the invocation of an interpreter at the command line.

 
import java.util.Scanner;
 
public class CopyStdinToStdout {
 
    public static void main(String[] args) {
        try (Scanner scanner = new Scanner(System.in);) {
            String s;
            while ( (s = scanner.nextLine()).compareTo("") != 0 ) {
                System.out.println(s);
            }
        }
    }
 
}
 