It raises the compiler error because you break one of the core principles of inheritance in Java (and in OOP proper). This principle is the overriding member cannot impose more restrictions to the caller than the overridden member, as declared in the super class, even if we discuss about access type or declared exception types.
In your case, ClassNotFoundException
is not declared in the super class, nor any of its ancestors.