title: IntelliJ - Invalid source release: 17
body: <p>I've created a new Java project in IntelliJ with Gradle that uses Java 17. When running my app it has the error <code>Cause: error: invalid source release: 17</code>.</p>
  <p><strong>My Settings</strong></p>
  <p>I've installed <code>openjdk-17</code> through <code>IntelliJ</code> and set it as my <code>Project SDK</code>.</p>
  <p>The <code>Project language level</code> has been set to <code>17 - Sealed types, always-strict floating-point semantics</code>.</p>
  <p><a href="https://i.stack.imgur.com/h6OBn.png" rel="noreferrer"><img src="https://i.stack.imgur.com/h6OBn.png" alt="enter image description here" /></a></p>
  <p>In <code>Modules -&gt; Sources</code> I've set the <code>Language level</code> to <code>Project default (17 - Sealed types, always strict floating-point semantics)</code>.</p>
  <p><a href="https://i.stack.imgur.com/WxHWG.png" rel="noreferrer"><img src="https://i.stack.imgur.com/WxHWG.png" alt="modules-&gt;sources" /></a></p>
  <p>In <code>Modules -&gt; Dependencies</code> I've set the <code>Module SDK</code> to <code>Project SDK openjdk-17</code>.</p>
  <p><a href="https://i.stack.imgur.com/0DMAk.png" rel="noreferrer"><img src="https://i.stack.imgur.com/0DMAk.png" alt="modules-&gt;dependencies" /></a></p>
  <p>In <code>Settings -&gt; Build, Execution, Deployment -&gt; Compiler -&gt; Java Compiler</code> I've set the <code>Project bytecode version</code> to <code>17</code>.</p>
  <p><a href="https://i.stack.imgur.com/jZxak.png" rel="noreferrer"><img src="https://i.stack.imgur.com/jZxak.png" alt="enter image description here" /></a></p>
  <p><strong>Gradle</strong></p>
  <pre><code>plugins {
      id 'org.springframework.boot' version '2.5.6'
      id 'io.spring.dependency-management' version '1.0.11.RELEASE'
      id 'java'
  }
  
  group = 'com.app'
  version = '0.0.1-SNAPSHOT'
  sourceCompatibility = '17'
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
      implementation 'org.springframework.boot:spring-boot-starter-web'
      implementation 'org.springframework.boot:spring-boot-starter-websocket'
      testImplementation 'org.springframework.boot:spring-boot-starter-test'
      implementation 'com.fasterxml.jackson.core:jackson-core:2.13.0'
      implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.0'
  }
  
  test {
      useJUnitPlatform()
  }
  </code></pre>
  <p>I've looked at all of the answers <a href="https://stackoverflow.com/questions/46280859/intellij-idea-error-java-invalid-source-release-1-9">here</a> but I can't seem to fix this. I must be missing something but I can't find it. I've not had any problems using Java 8 or 11.</p>
  <p>How do I resolve this?</p>