I read this post
How do I tell Gradle to use specific JDK version?
which seems to miss the point. Developers should be responsible for setting their own JAVA_HOME to where they installed it which is different on different OS.
What I would like is to set which jdk major version should be in use like 1.8 so it fails if their JAVA_HOME is pointing to 1.7 with a nice error message saying please fix your JAVA_HOME variable.
Is this possible in gradle?
The important part is to have something in my git repo that says gradle.jdk.must.be=1.8 and if using JAVA_HOME OR using gradle.properties from their home directory or whatever, it tries to compile using JAVA_HOME and if it fails, it should tell them nicely to setup JAVA_HOME or gradle.properties or whatever.
Related post: How to set JDK version in Gradle project WITHOUT explicit JDK path?
The point being when someone checks out a project, it is sort of confusing when it just doesn't compile and they don't know why with no error telling them what to fix.
thanks, Dean