Skip to content

Instantly share code, notes, and snippets.

Created December 11, 2014 20:02
Show Gist options
  • Save anonymous/2da6d498146066c65d4b to your computer and use it in GitHub Desktop.
Save anonymous/2da6d498146066c65d4b to your computer and use it in GitHub Desktop.
JRuby become_java! ignoring java_package
require 'jruby/core_ext'
require 'java'
java_package 'rxtest.foobar'
class Foo
print "Heigh-ho!\n"
def bar()
puts "Called."
end
end
Foo.become_java!("")
# Output
# % javap -classpath . rubyobj.Foo
# public class rubyobj.Foo extends org.jruby.RubyObject implements org.jruby.java.codegen.Reified {
# public static void clinit(org.jruby.Ruby, org.jruby.RubyClass);
# public rubyobj.Foo(org.jruby.Ruby, org.jruby.RubyClass);
# public rubyobj.Foo();
# public org.jruby.runtime.builtin.IRubyObject bar();
# }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment