title: How to specify Java version in Spring/Spring Boot pom.xml?
body: <p>What is the correct way of specifying Java 11 as the version to be used in Spring (or Spring Boot) pom.xml file?</p>
  
  <p>I.e., what value do I need to put in the <code>java.version</code> property of the pom?</p>
  
  <p>For Java 8 we use <code>1.8</code>, just like <a href="https://spring.io/guides/gs/spring-boot/#use-maven" rel="noreferrer">the documentation shows</a>, for Java 9 it's <code>1.9</code>.</p>
  
  <p>I'm not sure if Java 11 would be <code>1.11</code> (although it seems unlikely), and I've seen it specified as just <code>11</code> when using <code>maven-compiler-plugin</code>, however I'm not using the compiler plugin.</p>
  
  <p>e.g. </p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
      &lt;version&gt;3.8.0&lt;/version&gt;
      &lt;configuration&gt;
          &lt;release&gt;11&lt;/release&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>I've searched around and couldn't find the answer, as pretty much any documentation I've read as well as blog posts related to the Java version only show versions 8 or 9.</p>
  
  <p>So what should I use? <code>1.11</code> or just <code>11</code>?</p>
  
  <p>I tried both and my web server seems to start correctly and compile correctly (IntelliJ shows <code>Information:javac 11.0.2 was used to compile java sources</code>) however I'm not entirely convinced that changing the <code>java.version</code> value is doing anything, because I can set it to e.g. <code>100</code> and everything works fine.</p>
  
  <p>The only related questions I could find are: <a href="https://stackoverflow.com/questions/51427248/minimum-spring-version-compatible-with-java-11">Minimum Spring version compatible with Java 11</a>, <a href="https://stackoverflow.com/questions/52512058/spring-boot-fails-due-to-a-hibernate-error-after-migrating-to-jdk-11?noredirect=1&amp;lq=1">Spring Boot fails due to a Hibernate error after migrating to JDK 11</a> and <a href="https://stackoverflow.com/questions/52891927/spring-4-3-x-with-openjdk-11">Spring 4.3.x with OpenJDK 11</a>, but they don't really shed any light.</p>