My project runs on the command line but fails to run in IntelliJ. I've tried all of the solutions in the following questions:

* [Error: Java: invalid target release: 11 - IntelliJ IDEA](https://stackoverflow.com/q/54137286/715608)
* [Execution failed for task ':compileJava'. Gradle](https://stackoverflow.com/q/42529580/715608)
* [Execution failed for task ':compileJava'. > invalid source release: 1.7](https://stackoverflow.com/q/30450923/715608)

[![enter image description here](https://i.stack.imgur.com/8b89D.png)](https://i.stack.imgur.com/8b89D.png)

[![enter image description here](https://i.stack.imgur.com/X6NlO.png)](https://i.stack.imgur.com/X6NlO.png)

[![enter image description here](https://i.stack.imgur.com/oJkOJ.png)](https://i.stack.imgur.com/oJkOJ.png)

### However I did notice that Gradle is compiling the project with the wrong JDK

Does anyone know why InteliJ is not using the JDK I defined?

[![enter image description here](https://i.stack.imgur.com/NK2k5.png)](https://i.stack.imgur.com/NK2k5.png)

### I also tried overriding JAVA\_HOME

[![enter image description here](https://i.stack.imgur.com/9mdKc.png)](https://i.stack.imgur.com/9mdKc.png)