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

Open
headius opened this issue Aug 9, 2019 · 0 comments

Comments

@headius
Copy link
Member

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 9.2.8.0 milestone Aug 9, 2019

headius added a commit to headius/jruby that referenced this issue Aug 9, 2019

Add home and pwd .jruby.java_opts files to java cli.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.