On Mon, 28 Sep 2026 21:09:34 GMT, Marius Hanl <[email protected]> wrote:

> I just tried overriding `-PJDK_HOME`, with and without `auto-detect`.
> 
> Example, on master: `bash gradlew sdk -PJDK_HOME=~/dev/sdk/java/java26` -> 
> Works Example, this branch: `bash gradlew sdk 
> -PJDK_HOME=~/dev/sdk/java/java26` -> `Cannot find a Java installation on your 
> machine (Linux 7.2.8-1-cachyos amd64) matching: {languageVersion=26`

To answer directly, `-PX` defines a [project 
property](https://docs.gradle.org/current/userguide/build_environment.html#sec:project_properties)
 `X`. For it to be useful, it needs to be read with `project.findProperty("X")` 
(or `providers.gradleProperty`). In the main build it is not done so; 
`JDK_HOME` is read directly from the environment variables:

def envJavaHome = cygpath(System.getenv("JDK_HOME"))

If you want to override it in the CLI, you either need to set it there or we 
need to add manual reading for it. Since `JDK_HOME` is used for JavaFX only, is 
there a particular reason you need to override it in the CLI?

I have a branch that organizes the various versions variables to something that 
is more easily understood. I'll see if it makes sense to merge it before this 
change when reviewers get to this.

-------------

PR Comment: https://git.openjdk.org/jfx/pull/2294#issuecomment-5895933732

Reply via email to