For maven project, the required java sdk to build the project is specified in pom.xml's below section
<properties>
<rest-assured.version>5.5.0</rest-assured.version>
<java.version>21</java.version>
<log4j2.version>2.19.0</log4j2.version>
<cxf.version>4.0.0</cxf.version>
</properties>
Need to set the project's buildpath to the matched jdk version to make eclipse build work