Two ways
- In
gradle.properties
in the.gradle
directory in yourHOME_DIRECTORY
setorg.gradle.java.home=/path_to_jdk_directory
or:
-
In your
build.gradle
compileJava.options.fork = true compileJava.options.forkOptions.executable="/path_to_javac"
More Related Contents:
- How to add local .jar file dependency to build.gradle file?
- Is it possible to declare a variable in Gradle usable in Java?
- How do I exclude all instances of a transitive dependency when using Gradle?
- Creating runnable JAR with Gradle
- Peer not authenticated while importing Gradle project in eclipse
- Gradle – Could not find or load main class
- JCenter deprecation; impact on Gradle and Android
- What does transitive = true in Gradle exactly do (w.r.t. crashlytics)?
- java.util.scanner throws NoSuchElementException when application is started with gradle run
- Add classpath in manifest using Gradle
- Maven profiles equivalent of Gradle
- Error: Gradle: execution failed for task ‘:app:preDexDebug’
- How can I force Gradle to set the same version for two dependencies?
- Error:Execution failed for task ‘:app:packageRelease’. > Unable to compute hash of /../AndroidStudioProjects/../classes.jar
- Manifest merger failed : Attribute application@appComponentFactory updating Firebase libraries
- How to run Gradle test when all tests are UP-TO-DATE?
- How to add ojdbc7 to Java web app by Gradle?
- Gradle proxy configuration
- How to build sources JAR with Gradle?
- Ionic build Android error when downloading Gradle
- How to download older google play services?
- How do I add a new sourceset to Gradle?
- Setting active profile and config location from command line in spring boot
- How to specify the JDK version in Android Studio?
- Gradle always does println from any task
- Difference between google() and maven { url ‘https://maven.google.com’ }
- Gradle sourceCompatibility has no effect to subprojects
- Android Studio Build gradle OutOfMemoryError
- Jersey RESTful web service gradle setup
- IntelliJ IDEA: Run java with args from external file