I\'ve made a java program that takes input from stdin and returns output to stdout, which runs perfectly fine using:
cat inputfile | java -jar whatever.jar &l