views:

144

answers:

2

Is there a way to set Eclipse report compile errors same as javac?

I stumble upon few cases where something is working in eclipse, and cannot be compiled with javac. I understand that eclipse uses ECJ and that cannot be changed, but can it anywhere be set that everything that cannot compile with javac be a compile error in Eclipse? (since there are few things that you can make compile errors in Eclipse even if they are ok)

Examples are from @SuiteClasses({A.class,B.class,}) (last comma is the problem), to subtle generic problems that I fully don't understand.

A: 

You can make eclipse build use ant, that will in turn use javac.

daveb
+2  A: 

Eclipse uses ECJ for compilation via the Java Builder that is responsible for compiling and indexing all Java source files in order to make incremental compilation easier (making it easier for errors to be reported), apart from aiding refactoring and search operations.

ECJ happens to be the default and only compiler used by the Java builder; the compiler used cannot be configured. One cannot change it. However, you could attempt to add your own builder that uses an Ant build script relying on the javac compiler of the Sun JDK.

Vineet Reynolds
Could you explain how to change eclipse to use ant build script, or give some links related to it?
Sarmun
@Sarmun - Try this link http://www.eclipsezone.com/eclipse/forums/t65486.html
JasCav
@Jason, that's a pretty good link.
Vineet Reynolds
great, thanks!!
Sarmun