# Java interpreter for ruby?

**URL:** <https://www.ruby-forum.com/t/java-interpreter-for-ruby/130084>\
**Category:** Ruby\
**Created:** [February 25, 2008, 10:00am UTC](https://www.ruby-forum.com/t/java-interpreter-for-ruby/130084 "2008-02-25T10:00:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joe\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/5e9695/32.png) [@Joe\_K](https://www.ruby-forum.com/u/Joe_K)\
**Post date:** [February 25, 2008, 10:00am UTC](https://www.ruby-forum.com/t/java-interpreter-for-ruby/130084/1 "2008-02-25T10:00: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:** ![Joe\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/5e9695/32.png) [@Joe\_K](https://www.ruby-forum.com/u/Joe_K)\
**Post date:** [February 25, 2008, 10:19am UTC](https://www.ruby-forum.com/t/java-interpreter-for-ruby/130084/2 "2008-02-25T10:19:52Z")

</div>

How about using JRuby to run ruby on Java?

---

<div class="post-metadata">

**Author:** ![Joe\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/5e9695/32.png) [@Joe\_K](https://www.ruby-forum.com/u/Joe_K)\
**Post date:** [February 25, 2008, 1:35pm UTC](https://www.ruby-forum.com/t/java-interpreter-for-ruby/130084/3 "2008-02-25T13:35:44Z")

</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

---

<div class="post-metadata">

**Author:** ![Joe\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/5e9695/32.png) [@Joe\_K](https://www.ruby-forum.com/u/Joe_K)\
**Post date:** [February 25, 2008, 1:10pm UTC](https://www.ruby-forum.com/t/java-interpreter-for-ruby/130084/4 "2008-02-25T13:10:54Z")

</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
