# Using JRuby in eclipse

**URL:** <https://www.ruby-forum.com/t/using-jruby-in-eclipse/233542>\
**Category:** JRuby\
**Created:** [December 23, 2014, 8:41am UTC](https://www.ruby-forum.com/t/using-jruby-in-eclipse/233542 "2014-12-23T08:41:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [December 23, 2014, 8:41am UTC](https://www.ruby-forum.com/t/using-jruby-in-eclipse/233542/1 "2014-12-23T08:41:22Z")

</div>

I’m a Java programmer trying for the first time to use JRuby with  
eclipse. (I’m using Aptana plugin.)

I downloaded the .exe file of the latest JRuby, and Eclipse Java DLTK -  
Ruby Development Tools. I installed both of them.  
Then I set Ruby’s interpreter in eclipse to jruby.bat, and the engine  
debugger to be Ruby Built-In Debugger.

I wrote a simple Ruby code which compiled neatly and afterwards added:  
require ‘java’

I get an error message:

C:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core\_ext/kernel\_require.rb:55:in  
`require': cannot load such file -- java (LoadError) from C:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in`require’  
from C:/Users/eternalStudent/workspace/LetsTryRuby/HelloWorld.rb:1:in  
`’

What shall I do?

---

<div class="post-metadata">

**Author:** ![studenteternal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/67e7ee/32.png) [@studenteternal](https://www.ruby-forum.com/u/studenteternal)\
**Post date:** [December 23, 2014, 10:33am UTC](https://www.ruby-forum.com/t/using-jruby-in-eclipse/233542/2 "2014-12-23T10:33:14Z")

</div>

you are running your script with MRI and not JRuby so require ‘java’  
does  
not work.

---

<div class="post-metadata">

**Author:** ![studenteternal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/67e7ee/32.png) [@studenteternal](https://www.ruby-forum.com/u/studenteternal)\
**Post date:** [December 23, 2014, 10:57am UTC](https://www.ruby-forum.com/t/using-jruby-in-eclipse/233542/3 "2014-12-23T10:57:45Z")

</div>

How can I change that?

---

<div class="post-metadata">

**Author:** ![studenteternal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/67e7ee/32.png) [@studenteternal](https://www.ruby-forum.com/u/studenteternal)\
**Post date:** [December 23, 2014, 1:21pm UTC](https://www.ruby-forum.com/t/using-jruby-in-eclipse/233542/4 "2014-12-23T13:21:34Z")

</div>

Do you get that error executing from eclipse or the shell?

## Thanks, Ariel

Sent from my mobile device. Please excuse any errors.

---

<div class="post-metadata">

**Author:** ![studenteternal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/67e7ee/32.png) [@studenteternal](https://www.ruby-forum.com/u/studenteternal)\
**Post date:** [December 23, 2014, 3:18pm UTC](https://www.ruby-forum.com/t/using-jruby-in-eclipse/233542/5 "2014-12-23T15:18:07Z")

</div>

executing from eclipse

---

<div class="post-metadata">

**Author:** ![studenteternal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/67e7ee/32.png) [@studenteternal](https://www.ruby-forum.com/u/studenteternal)\
**Post date:** [December 23, 2014, 5:24pm UTC](https://www.ruby-forum.com/t/using-jruby-in-eclipse/233542/6 "2014-12-23T17:24:47Z")

</div>

I found out what the problem was, my project was created with Aptana  
plugin which can only run as Ruby Application, the Eclipse Java DLTK -  
Ruby Development Tools I installed later allowed for a different kind of  
interpreter, and allow me to run the code as Ruby Script with the JRuby  
interpreter.  
So I apparently I can run JRuby as long as I remember not to use the  
previous plugin.

Thanks for those who tried to help, my deep appreciations.

---

<div class="post-metadata">

**Author:** ![studenteternal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/67e7ee/32.png) [@studenteternal](https://www.ruby-forum.com/u/studenteternal)\
**Post date:** [December 23, 2014, 3:28pm UTC](https://www.ruby-forum.com/t/using-jruby-in-eclipse/233542/7 "2014-12-23T15:28:25Z")

</div>

Unfortunately I do not use Eclipse. Is there a place in the IDE to set  
the  
path to JRuby SDK? Perhaps the default path is still configured for ruby  
2.1

## Ariel V. e-mail: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) website: [http://blog.arielvalentin.com](http://blog.arielvalentin.com) skype: ariel.s.valentin twitter: arielvalentin linkedin: [LinkedIn Login, Sign in | LinkedIn](http://www.linkedin.com/profile/view?id=8996534)

\*simplicity \*communication  
\*feedback \*courage \*respect
