Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the official JDK_JAVA_OPTIONS environment variable instead of JAVA_OPTS #612

Closed
practicalli-johnny opened this issue Oct 9, 2022 · 1 comment

Comments

@practicalli-johnny
Copy link
Contributor

From Java 9 onward JDK_JAVA_OPTIONS is the official environment variable for setting options for the Java Virtual Machine. JAVA_OPTS although common is not the official environment variable and probably should not be relied upon.

Update the Clojure.org website to use JDK_JAVA_OPTIONS rather than JAVA_OPTS, possibly mentioning JAVA_OPTS as a common but deprecated environment variable

The following use of JAVA_OPTS was found in the content of the site

content/releases/tools.adoc:28:

  • Add support to include the common JAVA_OPTS env var as JVM properties in user program execution

content/reference/deps_and_cli.adoc:469:
If JVM options are provided in the JAVA_OPTS environment variable, these will be included first on the command line (note: these options are not part of the command cache and may vary between executions).

content/reference/deps_and_cli.adoc:1144:

  • JAVA_OPTS - JVM options to be included in the user command being executed - not cached. Included before any -J command line parameters and any :jvm-opts
@puredanger
Copy link
Member

JAVA_OPTS is intentionally and explicitly being supported here as a way to pass JVM options only to the user process invoked by the cli. This is a feature of the Clojure CLI and is jvm version independent. It is not deprecated.

The other env var is a jvm feature of 9+ and will affect both the class path generating process and the user process. It also prints stuff to the output stream which may not be desirable.

So, not changing anything here, this is the intended and not deprecated behavior. Also see https://clojure.atlassian.net/browse/TDEPS-165

@puredanger puredanger closed this as not planned Won't fix, can't repro, duplicate, stale Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants