https://github.com/jruby/jruby/wiki/JRuby-Java-Options-Files I tried .jruby.java_opts file but it did not work. After I replaced jruby file in ~/.rvm/rubies/jruby-9.4.12.0/bin with jruby.sh file from the same directory, it started to work.