Ruby gem -> jruby -> .jar -> consumed by java?

Would it be possible via jruby to export to a .jar and then consume the
.jar from java?

The goal is to use a ruby gem in java.

So any comments on this? Interested if this is possible.

If it is possible (which is great!), I wonder what the api would look
like
on the java side when you import a ruby gem.

The goal is to use a ruby gem in a java application, using jruby export
to
.jar to make it available on the java side.

Hi,

On Jan 13, 2012, at 2:32 PM, S Ahmed wrote:

So any comments on this? Interested if this is possible.

If it is possible (which is great!), I wonder what the api would look like on
the java side when you import a ruby gem.

The goal is to use a ruby gem in a java application, using jruby export to .jar
to make it available on the java side.

I have successfully packaged rubygems in a jar1 and then used them
from a java application using JRuby’s RedBridge embedding API[2]. This
is pretty straightforward.

If you’re asking about compiling a rubygem into classfiles in a jar and
then invoking the compiled gem directly from java code somehow, I don’t
know if that is possible.

Rhett

http://blog.nicksieger.com/articles/2009/01/10/jruby-1-1-6-gems-in-a-jar
[2]: RedBridge · jruby/jruby Wiki · GitHub