Menu

Diamond operator is not supported in source

While running a Java project with IntelliJ, we might face an error stating "diamond operator is not supported in -source 1.5", which means we are trying to run the project on a lower version of Java which is developed on a higher version.

Error statement 

java: diamond operator is not supported in -source 1.5

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


Solution/Apply the following fix

Go to File option from menu >> Project Structure >> Project Settings >> Modules. Here in Module, we need to use the higher version of language level under the Source tab 


Hope this helps you!



1 comment: