[jruby] Compiling to bytecode w/ 9.0.4.0?

Christian MICHON christian.michon at gmail.com
Fri Jan 22 06:49:28 JST 2016


What exact set of commands did you use to compile to bytecode?

Please share some code not compiling properly, even a 1 or 2 liners will
suffice.

On Thu, Jan 21, 2016 at 2:13 PM, Hugh Sasse <hgs at dmu.ac.uk> wrote:

> Hello,
> I'm using JRuby 9.0.4.0 on Windows 32 bit.
> I have not got any further with trying to get my code compiled to an
> executable jar file.  I have worked around my subclass of Hash
> needing the []() and []=() methods using fetch() and store() instead.
> However, has_key?() has me stumped, because jrubyc gives me
> errors relating to the unexpected '?' character, which cannot be
> name mangled into Java.  My attempts to solve this run into using
> things like member? which would need to be redefined.
>
> I read on https://github.com/jruby/jruby/wiki/JRubyCompiler
> that :
> """As of late September 2007, the JRuby compiler is considered complete.
> Any features missing are to be considered bugs. As part of JRuby's test
> run, the entire Ruby standard library is compiled to Java bytecode."""
>
> So, since I can't seem to use functions called member? or has_key? or
> include?,
> but the ones in the standard library are being used and converted into
> bytecode
> successfully, I am obviously doing this incorrectly.  My ability to find
> the correct
> way to do this by searching the web appears inadequate as well.
>
> So my question is, what should I have read that tells me how to get these
> methods
> that I redefine myself into bytecode, and thus into an executable jar
> file, please?
>
> Thank you,
> Hugh
>
>
>


-- 
Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ruby-lang.org/pipermail/jruby/attachments/20160121/9a5c4d45/attachment.html>


More information about the JRuby mailing list