When I'm going to compile a repository it seems I must guess which version of Java is intended. For example, if I want to compile elasticsearch I read the readme and execute ./gradlew assemble
. Eventually the build fails because I have Java8 and it requires Java11. It is a simple change, but is there a way for me to ask gradle (or maven, when applicable) for the version of Java before I start to compile?
How does developer tools deal with this? They can't possibly just try random versions of JDK until something works. Is it always manual?