Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
LoadError with 'compiled' ruby files with JRuby9000 #3018
Compiling any Ruby code into a class file and trying to load it afterwards leads to "LoadError: use `java_import' to load normal Java classes".
compiled and run with
Happens in both 220.127.116.11.pre2 and current master (393e64f).
This essentially breaks warblers 'compiled' feature - which uses shims in order to transparently load the generated class files (jruby/warbler#325).
I'm finding the same issue with 18.104.22.168.rc1 also. Your simple test case illustrates it well. It looks like you're using rvm or rbenv to launch jruby. I'm invoking it from jruby-complete.jar and getting the same result.
Trying to use "java_import" the ruby classes results in an error like:
Even if I rename the input file "Test.rb" with a capital "T", and it generates a java class called "Test", I still get the error:
By the way, have you noticed how much cleaner the compiled classes are? Version 1.7.20 produces class files that look like this:
Ok, this is fixed now for RC2. There's one caveat, however...
In order to speed load times, we have removed .class from load searching by default. In order to have JRuby search for .class, you'll need to pass