Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javac command line option to stop compiling after first error found

Sometimes you just do some typo in code but compiler will output dozens of errors, (actually it just fails to compile efter the first typo). So it would be very convenient sometimes to limit the compiler output to first error detected. GCC/Clang will accept -Wfatal-errors, can javac do the same? I am using JDK7 for Windows.

like image 513
exebook Avatar asked Dec 15 '22 13:12

exebook


1 Answers

See this answer: https://stackoverflow.com/a/3115546/500478

You can use -Xmaxerrs and -Xmaxwarns to set the maximal number of errors/warnings before javac gives up.

like image 142
Bastien Jansen Avatar answered May 18 '23 21:05

Bastien Jansen