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

Provide better documentation on java command @file support #5824

headius opened this issue Aug 9, 2019 · 1 comment

Provide better documentation on java command @file support #5824

headius opened this issue Aug 9, 2019 · 1 comment


Copy link

headius commented Aug 9, 2019

I was reminded today that the standard OpenJDK java command supports a special syntax to indicate there are Java options in a file:

java @path/to/opts_file.txt ...

Currently we only advise people to use -J flags or JAVA_OPTS environment variable. If we made this feature more visible, it would allow people to easily customize their Java options.

Some ideas:

  • Always look for a particular file in the current directory, similar to how we look for .jrubyrc. The file could be .jruby.java_opts and if present, it will be added to the Java command line.
  • Update all documentation that mentions JRUBY_OPTS to document the @file syntax and the above dotfile

Other thoughts?

@headius headius added this to the JRuby milestone Aug 9, 2019
headius added a commit to headius/jruby that referenced this issue Aug 9, 2019
This implements the dotfile idea from jruby#5824 in our bash launcher.
The order of precedence for options, indicated by their position
in the java command line, goes as follows:

* home dir .jruby.java_opts
* current dir .jruby.java_opts
* JAVA_OPTS environment variable
* command line flags

This allows users to set up global, local, and environment-based
java options but still override those at the command line.

An equivalent change will need to go into jruby-launcher.
@kares kares modified the milestones: JRuby, JRuby Aug 19, 2019
Copy link
Member Author

headius commented Oct 16, 2019

This is in! The PR is merged and we will include wiki updates and clear release notes to that effect.

@headius headius closed this as completed Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

2 participants