You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/framework-java_opts.md
+65-19Lines changed: 65 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,37 +26,83 @@ The framework can be configured by creating or modifying the [`config/java_opts.
26
26
27
27
Any `JAVA_OPTS` from either the config file or environment variables will be specified in the start command after any Java Opts added by other frameworks.
28
28
29
-
## Escaping strings
29
+
## Runtime variable expansion
30
30
31
-
Java options will have special characters escaped when used in the shell command that starts the Java application but the `$` and `\` characters will not be escaped. This is to allow Java options to include environment variables when the application starts.
31
+
Java options are assembled at container start by the buildpack's `profile.d` script
32
+
(`00_java_opts.sh`), then passed to the JVM by the shell-free `javaexec` launcher.
33
+
Because `javaexec` tokenizes `JAVA_OPTS` without invoking a shell, characters such as
34
+
`*`, `&`, `;`, `|`, and `>` are treated as literals — they reach the JVM exactly as
If an escaped `$` or `\` character is needed in the Java options they will have to be escaped manually. For example, to obtain this output in the start command.
37
+
### Environment variable references
38
38
39
-
```bash
40
-
-Dexample.other=something.\$dollar.\\slash
41
-
```
39
+
`$VARNAME` and `${VARNAME}` references in **both**`JAVA_OPTS` (env) and `java_opts`
40
+
(config) are expanded at container start against the runtime environment:
0 commit comments