Alex Rivera | Logout

Java compilation errors limited to 100

Asked 2010-06-25T04:27:33.860
43

I have a Java file,which when I compiled, I will be able to see only first 100 errors on console after that java compiler(javac) exits. How will I be able to see all the compilation errors on console? Thanks in advance- opensid

Edit
Report

4 Answers

43

Generally the compiler will give up after 100 errors. Most of the errors after this point will likely be caused by one of the first errors. If you must have more errors check out the javac options -Xmaxerrs and -Xmaxwarns

answered 2010-06-25T04:31:07.257
2

If you're using Eclipse, Preferences > Java > Compiler > Building > General will let you specify more problems per unit.

answered 2010-06-25T04:35:05.903
1

The Java compiler gives up after a certain number of errors when compiling a file because Java is one of those languages that's hard to re-synch source to expected state after an error. This means that one single misplaced semi-colon can generate dozens of errors (or more—way more in some extreme edge cases) that have little to nothing to do with the actual error. There's no point in printing out "all the errors" in your source code because the majority of them are likely phantom errors.

Fix the first few clear, understandable errors you can find in your compiler output and try again. (Don't forget to look for variants of those errors in the rest of your source!) Getting more error messages per compile run will probably not help and will instead, in fact, just serve to bewilder and dishearten.

answered 2010-06-25T04:38:10.350
0

If you are using Windows operating system then try to compile your sources using Command Prompt. Then that command prompt won't exit on errors.

answered 2010-06-25T04:34:42.527

Your Answer