# Java interpreter for ruby?

**URL:** <https://rubytalk.org/t/java-interpreter-for-ruby/44741>\
**Category:** ruby-talk\
**Created:** [25 February 2008 08:59 UTC](https://rubytalk.org/t/java-interpreter-for-ruby/44741 "2008-02-25T08:59:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joe\_K](https://avatars.discourse-cdn.com/v4/letter/j/5e9695/32.png) [@Joe\_K](https://rubytalk.org/u/Joe_K)\
**Post date:** [25 February 2008 08:59 UTC](https://rubytalk.org/t/java-interpreter-for-ruby/44741/1 "2008-02-25T08:59:57Z")

</div>

Hi, I'm looking for an interpreter for Java that allows me to run my Java  
programs on the ruby interpreter. I know there's a compiler that lets you  
run Java programs on the scala interpreter, but I can't find one to run  
Java on the ruby platform? Any help\>

---

<div class="post-metadata">

**Author:** ![Paul\_McMahon1](https://avatars.discourse-cdn.com/v4/letter/p/a88e4f/32.png) [@Paul\_McMahon1](https://rubytalk.org/u/Paul_McMahon1)\
**Post date:** [25 February 2008 09:18 UTC](https://rubytalk.org/t/java-interpreter-for-ruby/44741/2 "2008-02-25T09:18:51Z")

</div>

How about using JRuby to run ruby on Java?

---

<div class="post-metadata">

**Author:** ![simon\_jenkins](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@simon\_jenkins](https://rubytalk.org/u/simon_jenkins)\
**Post date:** [25 February 2008 12:35 UTC](https://rubytalk.org/t/java-interpreter-for-ruby/44741/3 "2008-02-25T12:35:00Z")

</div>

I am yet to give scala ago, however from my current understanding...

scala and java both compile to byte code that runs on the JVM. Therefore  
they both share a runtime which will make it more straightforward to get the  
two to co-operate.

The only "shared" runtime for java and ruby that I am aware of is, JRuby.

Alternatively if your application can be separated into tasks that do not  
need a high level of communication you could possibly spawn a java process  
seperate from the ruby process.

simon

> **···**
>
> On Mon, Feb 25, 2008 at 7:59 PM, Joe K \<jkauzlar@hotmail.com\> wrote:
> 
> > Hi, I'm looking for an interpreter for Java that allows me to run my Java  
> > programs on the ruby interpreter. I know there's a compiler that lets you  
> > run Java programs on the scala interpreter, but I can't find one to run  
> > Java on the ruby platform? Any help\>

---

<div class="post-metadata">

**Author:** ![Jaypee1](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@Jaypee1](https://rubytalk.org/u/Jaypee1)\
**Post date:** [25 February 2008 12:10 UTC](https://rubytalk.org/t/java-interpreter-for-ruby/44741/4 "2008-02-25T12:10:03Z")

</div>

Paul McMahon a écrit :

> How about using JRuby to run ruby on Java?

JRuby can also be used as a glue to assemble Java  
objects. For example, it is possible to parse a  
ruby String containing some xml, using JDOM and  
SAXBuilder. But some special attention must be paid  
to constructing Java arrays from ruby.

J-P
