CodexBloom - Programming Q&A Platform

Eclipse JDT not recognizing Java 17 in my Spring Boot application - unresolved type issues

👀 Views: 18 đŸ’Ŧ Answers: 1 📅 Created: 2025-06-01
eclipse java-17 spring-boot maven Java

I'm working with an scenario in Eclipse 2023-09 where the Java Development Tools (JDT) are not recognizing Java 17 features in my Spring Boot 2.7 application. I have set my project to use Java 17 in the project properties, and the compliance level is also set to 17. However, I keep working with unresolved type errors when I try to use features like the `sealed` class. My `pom.xml` has the correct properties as well: ```xml <properties> <java.version>17</java.version> </properties> ``` I tried cleaning and rebuilding the project multiple times, refreshing the Maven dependencies, and even updating the Maven compiler plugin to the following version: ```xml <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> <source>17</source> <target>17</target> </configuration> </plugin> </plugins> </build> ``` Despite these efforts, I still see the behavior messages in Eclipse: ``` The type 'sealed' is not recognized ``` I've also checked the installed JREs in Eclipse, ensuring that Java 17 is included and set as the default. The project is configured to use the Project Facets for Java 17 as well. Has anyone else faced similar issues with Eclipse not recognizing the Java version correctly, or could there be a bug with the JDT in this specific configuration? Any suggestions on how to resolve these unresolved type issues would be greatly appreciated. I've been using Java for about a year now. I'm open to any suggestions. I'm working in a macOS environment.