Eclipse normally use its own compiler, JDT Core, which support many features Oracle JDK doesn't.
https://www.eclipse.org/jdt/core/
> 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.