The target JRE version for Gradle can be configured from within Intellij via the Gradle JVM setting at Preferences (cmd + ,) > Build, Execution, Deployment > Gradle:

The project JDK version can be configured from the Project SDK setting in Project Structure (cmd + ;):

(Screenshots taken from IntelliJ IDEA 2020.1.4)