Skip to content

Commit 9f86de5

Browse files
SajeerSajeer
authored andcommitted
Toolchain doc updated for showing precedence for JAVA_HOME set for the environment and jvmOptions
1 parent d49da33 commit 9f86de5

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

docs/toolchain.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ When `jdkToolchain` is configured, the Liberty Maven Plugin uses Maven's toolcha
7676
- If a matching toolchain is found, the plugin uses that toolchain to determine a `JAVA_HOME` and runs Liberty server commands using that `JAVA_HOME`.
7777
- If no matching toolchain is found (or `jdkHome` is not available), the plugin logs a warning and runs using the same JDK that is used to run Maven.
7878

79-
If `JAVA_HOME` is already set in `server.env` or `jvm.options`, that configuration takes precedence. In that case, the plugin logs a warning and does not apply the toolchain.
79+
If `JAVA_HOME` is already set in `server.env` or `jvm.options`, or is provided through Maven project properties (for example, `liberty.env.JAVA_HOME` or `jvmOptions` properties), that configuration takes precedence. In that case, the plugin logs a warning and does not apply the toolchain.
8080

8181

8282
###### Dev mode
@@ -107,9 +107,9 @@ Dev mode (`liberty:dev`) uses the configured `jdkToolchain` in two places:
107107

108108
Liberty Maven Plugin logs a warning and runs using the same JDK that is used to run Maven.
109109

110-
- **`JAVA_HOME` set in `server.env` or `jvm.options`**
110+
- **`JAVA_HOME` set for the server (`server.env`, `jvm.options`, or Maven project properties)**
111111

112-
`JAVA_HOME` takes precedence over the toolchain. Liberty Maven Plugin logs a warning and does not apply the toolchain.
112+
`JAVA_HOME` configured for the server takes precedence over the toolchain. This includes values set directly in `server.env` or `jvm.options`, as well as values provided through Maven project properties that generate those files (for example, `liberty.env.JAVA_HOME` or `jvmOptions` properties). In these cases, Liberty Maven Plugin logs a warning and does not apply the toolchain.
113113

114114
- **Dev mode compilation**
115115

@@ -136,7 +136,8 @@ Configured toolchain JDK 11 for Liberty Maven Plugin, but added only JDK 17 in t
136136
**If you see a warning that toolchain is not honored because JAVA_HOME is configured:**
137137

138138
- Check `server.env` and `jvm.options` for `JAVA_HOME`.
139-
- Remove `JAVA_HOME` if you want the toolchain JDK to be used.
139+
- Check your Maven project properties for values that set `JAVA_HOME`, such as `liberty.env.JAVA_HOME` or `jvmOptions` properties.
140+
- Remove or adjust these settings if you want the toolchain JDK to be used.
140141

141142
**Example - JAVA_HOME specified in server.env**
142143

0 commit comments

Comments
 (0)