title: Apache Maven: Diamond operator is not supported in -source 1.5
body: <p>I build and run my Java Apache Camel code with the command </p>
  
  <pre><code>mvn clean compile camel:run
  </code></pre>
  
  <p>This command has always worked for me, however when I have code that uses diamond operator I get an error.</p>
  
  <p>My diamond operator:</p>
  
  <pre><code>private List&lt;RestPropertyDefinition&gt; restProperties = new ArrayList&lt;&gt;();
  </code></pre>
  
  <p>My error:</p>
  
  <pre><code>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project camel-rest-example: Compilation failure
  [ERROR] /home/sindre/IdeaProjects/training/camelrestexample/src/main/java/com/test/EmployeeRoute.java:[21,73] diamond operator is not supported in -source 1.5
  [ERROR]   (use -source 7 or higher to enable diamond operator)
  </code></pre>
  
  <p>My POM File:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.test&lt;/groupId&gt;
      &lt;artifactId&gt;camel-rest-example&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  
      &lt;dependencies&gt;
          &lt;!-- https://mvnrepository.com/artifact/org.apache.camel/camel-core --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-core&lt;/artifactId&gt;
              &lt;version&gt;2.20.0&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- https://mvnrepository.com/artifact/org.apache.camel/camel-spring --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-spring&lt;/artifactId&gt;
              &lt;version&gt;2.20.0&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;spi-annotations&lt;/artifactId&gt;
              &lt;version&gt;2.20.0&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- https://mvnrepository.com/artifact/org.apache.camel/camel-jms --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-jms&lt;/artifactId&gt;
              &lt;version&gt;2.20.0&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-http4&lt;/artifactId&gt;
              &lt;version&gt;2.20.0&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
              &lt;artifactId&gt;camel-quartz&lt;/artifactId&gt;
              &lt;version&gt;2.20.0&lt;/version&gt;
          &lt;/dependency&gt;
  
  
          &lt;!-- https://mvnrepository.com/artifact/org.apache.activemq/activemq-all --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.activemq&lt;/groupId&gt;
              &lt;artifactId&gt;activemq-all&lt;/artifactId&gt;
              &lt;version&gt;5.15.1&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-log4j12 --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
              &lt;version&gt;1.7.25&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
  
      &lt;/dependencies&gt;
  
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;!-- Allows the routes to be run via 'mvn camel:run' --&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
                  &lt;artifactId&gt;camel-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.20.0&lt;/version&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>I am using Java 8, on Ubunut 18.04 with IntelliJ IDEA. It looks like IntelliJ believes that I am using Java 5? But I only have Java 8 installed on my machine</p>