Home » Software » Connecting Ruby to Java Programming

Connecting Ruby to Java Programming

ruby-to-java Connecting Ruby to Java ProgrammingConnecting Ruby and Java is possible these days. Like integrating C++ in Java using Java Native Interface (JNI) you can integrate ruby’s code to java using Ruby to Java Bridges. Over the last six years, Intergrating ruby’s code on Java solutions have emerged. Although how they solve the problem are similiar. The real implementation are very different.

List of bridge software to Connecting Ruby to Java Programming

Here are the list of bridge software that you can use to integrate ruby on java enviroment

  1. Ruby/Java Bridge (RJB),  This is a bridge that implement the Java Native Interface (JNI). Java’s JNI is used primarily for C to Java integration and it’s a high-performance API. The performance is good as well as the package is under active development. Although this bridge is more difficult to set up than some of the others, especially on alternate platforms such as Microsoft Windows Operating System. But once it’s set up, it’s easy to use.
  2. Yet Another Java Bridge (YAJB), YAJB provides a communication facility between Ruby and Java. The current implementation is written in Java and ruby on rails so as to run on many platforms. This bridge uses a common communication strategy called XML remote procedure calls. YAJB is very easy to install and configure. You don’t need a C compiler to deploy it; you just drop the libraries into the right directory. This bridge is reasonably up-to-date, and seems to be actively maintained. There’s an active mailing list. YAJB is a coarse, tactical tool.
  3. Ruby to Java Native Interface (RJNI), RJNI uses the Java Native Interface (JNI) to provide a Ruby to Java bridge with high performance potential. It’s not under active development, and goes only one way (for example, you can’t do callbacks from Java, so rich user interface development is all but impossible). It was last updated more than a year ago, and it works only on Unix platforms, not Windows.
  4. RJava, RJava is a simple Ruby-to-Java interface. Rjava uses TCP/IP to communicate between Java and Ruby. Because it is not under active development, you should not be used it on production systems.

The most known Bridge software of Ruby to Java Programming is Ruby/Java Bridge (RJB).

Pros and Cons using Ruby to Java Bridge Software

The most prominent of these bridge software are YAJB and RJB. The others (Rjava and RJNI) are no longers actively maintained. These bridge software have some definite advantanges :

  1. They require only small libraries, and you can get them running relatively quickly (though the JNI versions have to be compiled).
  2. The API for both of the major implementations is focused and easy to understand.
  3. You can easily cross boundaries with a simple method call.

Although they have many advantages, they have limitations too. such as

  1. They don’t seek to make transparent, bidirectional access between languages. You won’t be able to build frameworks that have much bidirectional communication, such as plugging a Ruby business rule into a Java rules engine, for example.
  2. They don’t seek broader integration to programming languages beyond Java or Ruby. Your interfaces will be usable only between Ruby and Java.

One thought on “Connecting Ruby to Java Programming

  1. MARCOS says:

    Hi all, here every person is sharing these kinds of know-how, so its nice to read this website, and I used to go to see this blog daily.

Leave a Reply

Your email address will not be published. Required fields are marked *

Name *
Email *
Website