1

I cannot send output of JAVAC command in command prompt to a file with javac >f.txt & f.txt command. It creates only a 0byte file.

2
  • you're using unix? then javac ... 2> out.txt should do it Commented Jul 1, 2018 at 2:40
  • No i am using windows Commented Jul 2, 2018 at 1:03

1 Answer 1

3

The problem is that javac writes compilation error messages to standard error rather than standard output. Try this:

  $ javac 2>f.txt YourClass.java
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.