# Help - how to call java classes from controller

**URL:** <https://www.ruby-forum.com/t/help-how-to-call-java-classes-from-controller/86076>\
**Category:** Rails\
**Created:** [February 19, 2007, 6:11pm UTC](https://www.ruby-forum.com/t/help-how-to-call-java-classes-from-controller/86076 "2007-02-19T18:11:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmehta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ea666f/32.png) [@rmehta](https://www.ruby-forum.com/u/rmehta)\
**Post date:** [February 19, 2007, 6:11pm UTC](https://www.ruby-forum.com/t/help-how-to-call-java-classes-from-controller/86076/1 "2007-02-19T18:11:45Z")

</div>

hi,

I need help to call java classes from the a controller action. I can  
call a java class from a ruby script, but when I am trying to call in  
controller, then

require ‘java’

itself gives me load error.

I have java 1.4, jruby 0.9.0 and ruby 1.8.5 installed.

I have tried to start server as :

jruby script/server but it does not work.

In my application I need to use 3rd party java apis. How can I call  
external ruby script from controller action if that can work ?

Any help is greatly appreciated.

---

<div class="post-metadata">

**Author:** ![rmehta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ea666f/32.png) [@rmehta](https://www.ruby-forum.com/u/rmehta)\
**Post date:** [February 19, 2007, 6:38pm UTC](https://www.ruby-forum.com/t/help-how-to-call-java-classes-from-controller/86076/2 "2007-02-19T18:38:23Z")

</div>

Sounds to me like it would be best to find a good JRuby forum to post  
your question. Sorry I have no experience with JRuby as is likely the  
case with most members of this forum.

---

<div class="post-metadata">

**Author:** ![rmehta](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ea666f/32.png) [@rmehta](https://www.ruby-forum.com/u/rmehta)\
**Post date:** [February 20, 2007, 10:09am UTC](https://www.ruby-forum.com/t/help-how-to-call-java-classes-from-controller/86076/3 "2007-02-20T10:09:00Z")

</div>

On Feb 19, 11:11 am, Rm Rm [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have java 1.4,jruby0.9.0 and ruby 1.8.5 installed.  
> Goodness. You need a much newer JRuby. JRuby 0.9.2 is the most recent  
> official release, and really most folks are running off trunk. At the  
> very least you should use 0.9.2. I’d also recommend you join the JRuby  
> lists to ask more questions…we’re very friendly 🙂

- Charlie
