java - How do I tell Gradle to use specific JDK version? -


i can't figure out working.

scenario:

  • i have application built gradle
  • the application uses javafx

what want

  • use variable (defined per developer machine) points installation of jdk used building whole application / tests / ...

i thought having gradle.properties file, defining variable. like

java_home_for_my_project=<path desired jdk> 

what don't want

  • point java_home desired jdk

i live many suggestions:

  • a solution defines system environment variable i'm able check in build.gradle script
  • a variable defined in gradle.properties
  • overriding java_home variable build context (something use java_home=<my special jdk path defined somewhere else defined>)
  • something else didn't think about

question:

  • how wire variable (how ever defined, variable in gradle.properties, system environment variable, ...) build process?

i have more 1 jdk7 available , need point special version (minimum jdk_u version).

any answer appreciated , i'm thankful every hint right direction.

two ways

  1. in gradle.properties in .gradle directory in home_directory set org.gradle.java.home=/path_to_jdk_directory

  2. in build.gradle

    compilejava.options.fork = true compilejava.options.forkoptions.executable = /path_to_javac 

Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -