I know there have been several questions in the past regarding things that compile in eclipse but not in command line, but I could not find an answer to my problem yet.
Eclipse use it's own java compiler implementation(ECJ) that have nothing to do with javac .
Eclipse Compiler for Java :
An incremental Java compiler. Implemented as an Eclipse builder, it is based on technology evolved from VisualAge for Java compiler. In particular, it allows to run and debug code which still contains unresolved errors.