# Porting ruby scripts to JRuby

**URL:** <https://www.ruby-forum.com/t/porting-ruby-scripts-to-jruby/161212>\
**Category:** Ruby\
**Created:** [February 24, 2009, 11:29am UTC](https://www.ruby-forum.com/t/porting-ruby-scripts-to-jruby/161212 "2009-02-24T11:29:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ulrichmp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/b77776/32.png) [@ulrichmp](https://www.ruby-forum.com/u/ulrichmp)\
**Post date:** [February 24, 2009, 11:29am UTC](https://www.ruby-forum.com/t/porting-ruby-scripts-to-jruby/161212/1 "2009-02-24T11:29:50Z")

</div>

Hi,

We are using some scripts written in Ruby and want to intergated these  
with a Java Tool.  
For this, we need to call these Ruby scripts from Java.I came to know  
that this can be done using JRuby.  
The Ruby scripts have been developed and run from Eclipse IDE.

If so, pls let us know how easy is it to port the Ruby Scripts to JRuby.

Also, is there any other means of calling the Ruby scripts from Java  
other than using JRuby?

Thanks in advance,  
Ulrich

---

<div class="post-metadata">

**Author:** ![ulrichmp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/b77776/32.png) [@ulrichmp](https://www.ruby-forum.com/u/ulrichmp)\
**Post date:** [February 24, 2009, 12:03pm UTC](https://www.ruby-forum.com/t/porting-ruby-scripts-to-jruby/161212/2 "2009-02-24T12:03:03Z")

</div>

On Feb 24, 2009, at 11:29 AM, Prakash Maria susai wrote:

> Also, is there any other means of calling the Ruby scripts from Java  
> other than using JRuby?
> 
> Thanks in advance,  
> Ulrich

If they are in pure ruby 1.8 and have no dependency to C-Extensions  
(even through gems), chances are very high[1] that they run as  
expected.

Otherwise, it’s a question whether those extensions are available  
in a Java Version or through FFI (Foreign Function Interface). FFI  
is pretty uncommon at the moment, but there is quite a bunch of  
gems that implement their extensions both for MRI and JRuby.

Regards,  
Florian

[1]: At this point: thanks to the JRuby-Team for the great work.

–  
Florian G.

smtp: removed\_email\_address@domain.invalid  
jabber: removed\_email\_address@domain.invalid  
gpg: 533148E2

---

<div class="post-metadata">

**Author:** ![ulrichmp](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/b77776/32.png) [@ulrichmp](https://www.ruby-forum.com/u/ulrichmp)\
**Post date:** [March 3, 2009, 3:33pm UTC](https://www.ruby-forum.com/t/porting-ruby-scripts-to-jruby/161212/3 "2009-03-03T15:33:31Z")

</div>

Florian G. wrote:

> On Feb 24, 2009, at 11:29 AM, Prakash Maria susai wrote:
> 
> > Also, is there any other means of calling the Ruby scripts from Java  
> > other than using JRuby?
> > 
> > Thanks in advance,  
> > Ulrich
> 
> If they are in pure ruby 1.8 and have no dependency to C-Extensions  
> (even through gems), chances are very high[1] that they run as  
> expected.
> 
> Otherwise, it’s a question whether those extensions are available  
> in a Java Version or through FFI (Foreign Function Interface). FFI  
> is pretty uncommon at the moment, but there is quite a bunch of  
> gems that implement their extensions both for MRI and JRuby.
> 
> Regards,  
> Florian
> 
> [1]: At this point: thanks to the JRuby-Team for the great work.
> 
> –  
> Florian G.
> 
> smtp: removed\_email\_address@domain.invalid  
> jabber: removed\_email\_address@domain.invalid  
> gpg: 533148E2

Hi,

Thanks for your response.  
Also is there any other mechanism of calling Ruby from Java  
other than using JRuby?

Thanks in advance,  
Ulrich
