Skip to content
Call JRuby from Java Example
Java Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Calling JRuby From Java

Here's a toy example of how to implement a Java interface method in JRuby and then call it from Java.

Compile it:
jrubyc --javac -cp . JrubyAdderImpl.rb
javac -cp /usr/local/jruby/lib/jruby.jar:.

Run the Java caller app:
java -cp /usr/local/jruby/lib/jruby.jar:. JavaCallerApp

Interested in computer science grad school? Find top computer science grad schools based on their research using
Something went wrong with that request. Please try again.