While trying to build a project using intelliJ Ultimate 12 I am getting these errors
use -source or higher to enable diamond operator
use -source 7 or higher
In addition to the accepted answer, you may also need to change the language level under Project Structure > Modules > Sources tab.
I also needed to change the java compiler being used at the IDE level under IntelliJ IDEA > Preference > Compiler > Java Compiler to 1.7 from 1.6. The exact location of the setting will vary based on your OS and version of IntelliJ IDEA.