title: Error: Java: invalid target release: 11 - IntelliJ IDEA
body: <p>I am trying to build an application which was built using java 8, now it's upgraded to java 11. I installed <a href="https://www.oracle.com/technetwork/java/javase/downloads/index.html" rel="noreferrer">Java 11</a> using <a href="https://docs.oracle.com/en/java/javase/11/install/installation-jdk-microsoft-windows-platforms.html#GUID-A7E27B90-A28D-4237-9383-A58B416071CA" rel="noreferrer">an oracle article</a> in my <strong>windows machine</strong> and I use <strong>IntelliJ IDEA 2017</strong> as my IDE.</p>
  
  <p>I changed my system environment variables and set the </p>
  
  <pre><code>JAVA_HOME to C:\Program Files\Java\jdk-11.0.1
  </code></pre>
  
  <p>And added that to the <code>Path</code> variable.</p>
  
  <pre><code>C:\&gt;java -version
  java version "11.0.1" 2018-10-16 LTS
  Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
  Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode) 
  </code></pre>
  
  <p>When I build my application in IntelliJ, this is what I get:</p>
  
  <pre><code>Information:java: Errors occurred while compiling module 'test-domain_main'
  Information: javac 1.8.0_171 was used to compile java sources
  Information:1/10/2019 4:21 PM - Compilation completed with 1 error and 0 warnings in 1s 199ms
  Error:java: invalid target release: 11
  </code></pre>
  
  <p>This is what I've tried so far:</p>
  
  <ol>
  <li><p>I changed <code>.idea/compiler.xml</code> target values from 8 to 11 but that didn't help. Also, verified the <code>Target bytecode version</code> in <code>settings &gt; Build, Execution, Deployment &gt; Compiler &gt; Java Compiler</code> and all my modules are set to 11. </p></li>
  <li><p>Went to <code>file &gt; Project Structure &gt; SDKs *(currently I have 1.7 and 1.7 listed)* &gt; Add new SDK &gt; JDK &gt;</code>
  After that, I selected <code>C:\Program Files\Java\jdk-11.0.1</code> But it errors out with "The selected directory is not a valid home for JDK"</p></li>
  </ol>
  
  <p>I am not sure if I installed the wrong JDK 11, because in my <code>C:\Program Files\Java\</code>, I see separate JDK and JRE folders for <code>1.7</code> and <code>1.8</code> but only JDK folder for <code>11.0.1</code></p>
  
  <p>Or is it something else I need to change? </p>