Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
LoadError with 'compiled' ruby files with JRuby9000 (using rescue) #3613
Compiling Ruby code into a class file and trying to load it afterwards leads to "LoadError: use java_import to load normal classes" if it includes a rescue command.
puts 'hello world' rescue nil
compiled and run with
This happens with the current 184.108.40.206 snapshot and all previous 9.0.x versions.
I can't reproduce this on 9.1 (ruby-2.3 branch) so it's possible I fixed it with other jrubyc fixes.
I just tested whether a JVM version difference in my stack could be the problem, but it seems that did not affect it.
The execution environment is the Docker official jruby:220.127.116.11-jre image. I originally built the jar on a Mac with Java 1.7.0_45 and rvm jruby-18.104.22.168. I retried building under the Docker official jruby:22.214.171.124-jdk image, but got the same error: