If you notice when running a Gradle task in IntelliJ that you get a Linkage Error or Gradle is trying to use a different JVM than expected, you need to change your Gradle JVM settings. For some reason, Gradle doesn't default to the project JDK. To change this setting, navigate to your IntelliJ settings, then follow "Build,Execution,Deployment"->"Build Tools"->"Gradle" and you will find a "Gradle JVM:" setting. Change it to the same as set in your project and you should be good to go.