Please tell me if it is possible to do the following:
May you provide a small working example?
EDIT: It turns out that embedding was the simplest way to achieve this. More information is available on Embedding JRuby.
x, JRuby internally needs to require 'java' so it has already required 'java' by the time your expression is evaluated. So technically it is true that "require 'java'" loads Java interoperability, but since our kernel does this now it is largely a no-op by the time you call it (see return value of the require).
JRuby is designed to work as a mixed-mode virtual machine for Ruby, where code can be either interpreted directly, just-in-time compiled at runtime to Java bytecode, or ahead-of-time compiled to Java bytecode before execution.
This was the solution I used : Direct JRuby embedding
Yes it's possible. This page on the JRuby wiki should get you started.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With