Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a Ruby app call Java code?

This is probably really simple, but all my Google results came back with JRuby, which isn't what I want to know. I'm curious if a regular Ruby app (e.g. a Rails app or a Sinatra app) could somehow be made to reference and call a Java library that's in the classpath? Ideally one that works on Heroku.

like image 266
Paul Avatar asked Apr 12 '11 19:04

Paul


1 Answers

Not directly. Java libraries run within the JVM, Ruby apps in their own VM. If you want those two to communicate, you will need to create some kind of a comms channel between them (there are various solutions, see f.e. http://code.google.com/p/activemessaging/).

like image 89
Tassos Bassoukos Avatar answered Nov 11 '22 11:11

Tassos Bassoukos