# \[HELP \] Call java code / method  from Ruby programming

**URL:** <https://discuss.rubyonrails.org/t/help-call-java-code-method-from-ruby-programming/67257>\
**Category:** rubyonrails-talk\
**Created:** [June 21, 2013, 3:04am UTC](https://discuss.rubyonrails.org/t/help-call-java-code-method-from-ruby-programming/67257 "2013-06-21T03:04:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Muthu\_Selvan](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@Muthu\_Selvan](https://discuss.rubyonrails.org/u/Muthu_Selvan)\
**Post date:** [June 21, 2013, 3:04am UTC](https://discuss.rubyonrails.org/t/help-call-java-code-method-from-ruby-programming/67257/1 "2013-06-21T03:04:13Z")

</div>

Hi All ,

I have written java code ( This java code will not return any thing but it will do action ) which is required call from ruby , please let me what is best way to achieve this ?

Thanks ,

Muthu Selvan SR

---

<div class="post-metadata">

**Author:** ![Colin\_Law1](https://avatars.discourse-cdn.com/v4/letter/c/91b2a8/32.png) [@Colin\_Law1](https://discuss.rubyonrails.org/u/Colin_Law1)\
**Post date:** [June 21, 2013, 7:36am UTC](https://discuss.rubyonrails.org/t/help-call-java-code-method-from-ruby-programming/67257/2 "2013-06-21T07:36:33Z")

</div>

You can use the ruby system method to run a command, which can be any language of course. Or you can use the backtick syntax.

Colin

---

<div class="post-metadata">

**Author:** ![11155](https://avatars.discourse-cdn.com/v4/letter/1/d26b3c/32.png) [@11155](https://discuss.rubyonrails.org/u/11155)\
**Post date:** [June 21, 2013, 2:23pm UTC](https://discuss.rubyonrails.org/t/help-call-java-code-method-from-ruby-programming/67257/3 "2013-06-21T14:23:57Z")

</div>

Colin Law wrote in post #1113075:

---

<div class="post-metadata">

**Author:** ![Jordon\_Bedwell](https://avatars.discourse-cdn.com/v4/letter/j/e480ec/32.png) [@Jordon\_Bedwell](https://discuss.rubyonrails.org/u/Jordon_Bedwell)\
**Post date:** [June 21, 2013, 2:28pm UTC](https://discuss.rubyonrails.org/t/help-call-java-code-method-from-ruby-programming/67257/4 "2013-06-21T14:28:08Z")

</div>

Did we all seem to forget there is something called jRuby?

> **[CallingJavaFromJRuby · jruby/jruby Wiki](https://github.com/jruby/jruby/wiki/CallingJavaFromJRuby)**
>
> JRuby, an implementation of Ruby on the JVM. Contribute to jruby/jruby development by creating an account on GitHub.
