problems while generating java code from jruby -
i have problems while generating .java files jruby 1.7.3. here example:
class duck def quack() puts "quack!"; end end def quack_it(duck) duck.quack end = duck.new quack_it(a)
when execute
jrubyc --java test.rb
following compilation error:
failure during compilation of file duckexample_simple.rb: undefined method `new_method' nil:nilclass.
therefore, have 2 questions:
- what wrong here?
- i want generate .java files in order see how jruby code translated bytecode , instead of reading bytecode thought read java code. generated java code correspond 1 1 bytecode generated aot jruby compiler, or it's better read bytecode itself? want see how jruby handles dynamic method dispatch @ bytecode level. hints appreciated.
i don't use jruby not best guy talk to, here 2 cents anyways.
if put simple class file, work. try
class duck def quack() puts "quack!" end end
it create duck.java
file expect, answeres second question had. there nice writeup generated file here: http://rhnh.net/2012/10/20/guice-in-your-jruby
i guess command broken. best open issue @ jruby issue tracker: http://jira.codehaus.org/browse/jruby
Comments
Post a Comment