Skip to content

Commit

Permalink
add JRuby 9.2 and Java 11 to the ci mix
Browse files Browse the repository at this point in the history
The `JAVA_OPTS` environment variable is used by JRuby to launch the JVM with
appropriate options; by adding specific `--add-opens` flags, we are able to
enable the specific reflective access that is necessary to run in Javas >= 9.
  • Loading branch information
yaauie committed Jan 20, 2019
1 parent 431dec4 commit 688bcf9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ matrix:
- rvm: jruby-9.1.9.0
- rvm: ruby-head
- env: "CHILDPROCESS_POSIX_SPAWN=true"
include:
- rvm: jruby-9.2.5.0
jvm: openjdk11
env: "JAVA_OPTS='--add-opens java.base/java.io=org.jruby.dist --add-opens java.base/sun.nio.ch=org.jruby.dist'"
exclude:
# Travis does not provide 1.9.3 on OSX
- rvm: 1.9.3
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ ChildProcess.logger = logger
## Caveats

* With JRuby on Unix, modifying `ENV["PATH"]` before using childprocess could lead to 'Command not found' errors, since JRuby is unable to modify the environment used for PATH searches in `java.lang.ProcessBuilder`. This can be avoided by setting `ChildProcess.posix_spawn = true`.
* With JRuby on Java >= 9, the JVM may need to be configured to allow JRuby to access neccessary implementations; this can be done by adding `--add-opens java.base/java.io=org.jruby.dist` and `--add-opens java.base/sun.nio.ch=org.jruby.dist` to the `JAVA_OPTS` environment variable that is used by JRuby when launching the JVM.


# Implementation

Expand Down

0 comments on commit 688bcf9

Please sign in to comment.