2024-10-18

Maven build script JDK version error

 
Issue:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project tn-hp-inc-gts-e4h-ws-keycloak-sample: Compilation failure
[ERROR] /C:/[Project]/SpringBootApplication.java:[4,32] cannot access org.springframework.boot.SpringApplication
[ERROR]   bad class file: [.m2]\repository\org\springframework\boot\spring-boot\3.3.1\spring-boot-3.3.1.jar(org/springframework/boot/SpringApplication.class)
[ERROR]     class file has wrong version 61.0, should be 52.0
[ERROR]     Please remove or make sure it appears in the correct subdirectory of the classpath.





Resolved by configured to Execution Environment.
Instead of Alternate JRE from reference URL, as if project been shared by a team via Git/SVN, which develop at different environments.








Reference URL:



If running from Eclipse (e.g. Maven commands), you need to be using the right JDK version for Run As -> Maven. Ensure that your JRE version is selected appropriately under the JRE tab:









No comments:

Google Referrals