microsoft / build-server-for-gradle

An implementation of the Build Server Protocol for Gradle
MIT License
55 stars 8 forks source link

Find compatible GradleJavaHome and notify client in case of incompatibility #165

Closed Tanish-Ranjan closed 3 months ago

Tanish-Ranjan commented 4 months ago

Addressing issue 75 and issue 76

Tanish-Ranjan commented 4 months ago

To check if the selected JDK is compatible or not we are now comparing the feature release of the Java Version. Previously, if we retrieved the latest compatible JDK version of say 21 and the client has JDK version 21.0.1. Then Runtime.Version#compareTo it would say the client JDK version is greater than the highest compatible Java version. So I have resorted to using the feature release for compatibility check.

Tanish-Ranjan commented 4 months ago

The JDK lookup for gradle seems to be different from the way it is listed in the docs.

Priority order I found out:

  1. Command Line args
  2. Gradle Properties
  3. Installed JDK (gets from the registry I think)
  4. JAVA_HOME (Env variable)
jdneo commented 3 months ago

Hi @Tanish-Ranjan, The PR has some conflicts with the develop branch now. Could you please resolve them?

Tanish-Ranjan commented 3 months ago

Prioritizing Gradle default behavior for java home detection with https://github.com/microsoft/build-server-for-gradle/pull/165/commits/3b6888733339c8f42229b18fa9cecfa09f84d500