Because Eclipse does not use javac, but its own compiler. From another topic: How to configure Java compiler instead of Eclipse for Eclipse IDE
On the JDT website:
Java incremental compiler. Implemented as an Eclipse builder, it is based on technology developed from VisualAge for the Java compiler. In particular, it allows you to run and debug code that still contains unresolved errors.
Keep in mind that for the library itself, Eclipse will still use one of the Sun compiler, which can be installed using the procedure explained by the other answers (NimChimpsky and The Elite).
nanda source share