0

Seems easy enough to write console output to file, but doing so appears to hijack the output stream from the console. Is there a way to write to the console and a file simultaneously?

2
  • 2
    If you are on Linux/Unix or Mac OS, you can just pipe your program to the tee utility, that does exactly that ( man7.org/linux/man-pages/man1/tee.1.html ), with no need to modify the Java source.
    – FBergo
    Commented May 7, 2018 at 18:54
  • If you want to do it in Java, see the dupe. But tee is a fine solution. Commented May 7, 2018 at 19:01

0

Browse other questions tagged or ask your own question.