You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
test.rb
puts'hello world'rescuenil
compiled and run with
jrubyc test.rb
jruby -e "load 'test.class'"
leads to
LoadError: test.class is not compiled Ruby; use java_import to load normal classes
load at org/jruby/RubyKernel.java:955
<top> at -e:1
This happens with the current 9.0.5.0 snapshot and all previous 9.0.x versions.
$ jruby -v
jruby 9.0.5.0-SNAPSHOT (2.2.3) 2016-01-22 d7aefef Java HotSpot(TM) 64-Bit Server VM 25.65-b01 on 1.8.0_65-b17 +jit [linux-amd64]
The text was updated successfully, but these errors were encountered:
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:9.0.5.0-jre image. I originally built the jar on a Mac with Java 1.7.0_45 and rvm jruby-9.0.5.0. I retried building under the Docker official jruby:9.0.5.0-jdk image, but got the same error:
LoadError: uri:classloader:/pacer-model/core.class is not compiled Ruby; use java_import to load normal classes
require at org/jruby/RubyKernel.java:937
require at /app/vendor/bundle/jruby/2.2.0/gems/polyglot-0.3.5/lib/polyglot.rb:65
<top> at /app/vendor/bundle/jruby/2.2.0/gems/pacer-model-2.5.0.pre-java/lib/pacer-model.rb:9
require at org/jruby/RubyKernel.java:937
(root) at /app/vendor/bundle/jruby/2.2.0/gems/polyglot-0.3.5/lib/polyglot.rb:1
<top> at /app/vendor/bundle/jruby/2.2.0/gems/polyglot-0.3.5/lib/polyglot.rb:65
require at org/jruby/RubyKernel.java:937
(root) at /app/vendor/bundle/jruby/2.2.0/gems/pacer-model-2.5.0.pre-java/lib/pacer-model/loader.rb:21
<top> at /app/vendor/bundle/jruby/2.2.0/gems/polyglot-0.3.5/lib/polyglot.rb:1
require at org/jruby/RubyKernel.java:937
<top> at /app/vendor/bundle/jruby/2.2.0/gems/polyglot-0.3.5/lib/polyglot.rb:65
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.
test.rb
compiled and run with
leads to
This happens with the current 9.0.5.0 snapshot and all previous 9.0.x versions.
The text was updated successfully, but these errors were encountered: