Java compiler and its cmd output


Java compiler and its cmd output



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.


javac >f.txt & f.txt





you're using unix? then javac ... 2> out.txt should do it
– nicksheen
Jul 1 at 2:40






No i am using windows
– SRIVISHNU BHARAT
Jul 2 at 1:03




1 Answer
1



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


javac


$ javac 2>f.txt YourClass.java






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

PySpark - SparkContext: Error initializing SparkContext File does not exist

List of Kim Possible characters

Python Tkinter Error, “Too Early to Create Image”