title: Switch from Java 8 to Java 11 in my IntelliJ gradle project, a issue comes at runtime
body: <p>I was using Java 8 for my gradle project, now I installed Java 11 &amp; try to switch to using Java 11.</p>
  <p>My Java 11 version details:
  <a href="https://i.stack.imgur.com/9Teeh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9Teeh.png" alt="enter image description here" /></a></p>
  <p>My gradle project has following configuration in <code>build.gradle</code> file:</p>
  <pre><code>plugins {
      id 'org.springframework.boot' version '2.5.3'
      id 'io.spring.dependency-management' version '1.0.11.RELEASE'
      id 'java'
  }
  
  group = 'com.my.webapp.xi'
  version = '0.0.1-SNAPSHOT'
  sourceCompatibility = '11'
  
  repositories {
      mavenCentral()
  }
  ...
  ...
  </code></pre>
  <p>As you can see above I have <code>sourceCompatibility = '11'</code> now, it used to be <code>sourceCompatibility = '8'</code>.</p>
  <p>In my IntelliJ  <code>Project strucutre</code> settings, I have chosen Java 11 instead of 8 as well:</p>
  <p><a href="https://i.stack.imgur.com/KSwoh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KSwoh.png" alt="enter image description here" /></a></p>
  <p>There is no issue building the project. But when I run my java gradle project my Intellij gives me this error:</p>
  <p><a href="https://i.stack.imgur.com/u3Yll.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/u3Yll.png" alt="enter image description here" /></a></p>
  <p>If above screenshot error is not enough, here is the complete error message from Intellij:</p>
  <pre><code>&gt; Process 'command '/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
  
  </code></pre>
  <p>When I was using Java 8 (in both build.gradle &amp; the settings of Intellij) it was fine without any issue but when I switch to Java 11 this issue comes,</p>
  <p>I also tried switching to Java 16, I get the same issue.</p>
  <p>What am I missing? What could be the reason? Where should I check?</p>