I am trying to deploy a Java application to Heroku targeting OpenJDK 11. I've added a system.properties
file to the root of my application with the following content, as per Heroku instructions:
java.runtime.version=11
However, when I deploy, I get the following Gradle error:
Gradle app detected
-----> Installing JDK 1.8... done
-----> Building Gradle app...
-----> executing ./gradlew jar
Downloading https://services.gradle.org/distributions/gradle-4.10-all.zip
Welcome to Gradle 4.10!
[Gradle highlights]
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Could not target platform: 'Java SE 11' using tool chain: 'JDK 8 (1.8)'.
How can I get Heroku to detect and use the correct Java version?