Project setup issues in Intelij IDEA - Community Edition 2024.2 (java:diamond operator is not supported in source 1.5(use -source 7 or higher to enable diamond operator).)

已回答

Project setup issues in Intelij IDEA - Community Edition 2024.2.

Unable to run java applications, getting error as 

java:  diamond operator is not supported in -source 1.5

(use -source 7 or higher to enable diamond operator).

Please note that I am using jdk 1.8 in the Edit configurations → Buil&Run and in File→Settings→Complier→JavaCompiler

I am using maven spring boot project. Could you please help me to resolve this issue.

 

I am using the code as 

List<TestDTO> test = new ArrayList<>();

0
Hello, the diamond operator is supported from Java 7 onwards. Ensure your project language level is set to 7 or higher in IntelliJ IDEA. Go to File → Project Structure → Project, and set 'Project language level' to 7 or higher.
0

I am already using language level as 8. Please note that mvn clean install is working from Intelij (getting ‘Build Success’), but while running the project I am getting this error.

0
Hi Silviyageorge06, please provide a minimal sample project so I can reproduce the issue without including your sensitive code. If reproduced, I'll create an issue report for you.
0

请先登录再写评论。