# Running JRuby

**URL:** <https://www.ruby-forum.com/t/running-jruby/76195>\
**Category:** Ruby\
**Created:** [March 3, 2006, 11:21am UTC](https://www.ruby-forum.com/t/running-jruby/76195 "2006-03-03T11:21:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![peterk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/7993a0/32.png) [@peterk](https://www.ruby-forum.com/u/peterk)\
**Post date:** [March 3, 2006, 11:21am UTC](https://www.ruby-forum.com/t/running-jruby/76195/1 "2006-03-03T11:21:23Z")

</div>

Im trying to set up java and jruby on Windows, great work with the  
recent developments.

In some of the recent examples of irb running on jruby it is ran like:

C:\rails\>jruby C:\ruby\bin\irb

If I run this I get:

c:\ruby\bin\irb:10:in ‘require’: No such file to load – irb (LoadError)  
from c:\ruby\bin\irb:10"

I have set both JAVA\_HOME and JRUBY\_HOME.

Many thanks, Pete.

PS. When setting JRUBY\_HOME enviroment var it appears it cant have any  
spaces in the path, this is on Windows. And is most likly something to  
do this ‘DOS’.

---

<div class="post-metadata">

**Author:** ![peterk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/7993a0/32.png) [@peterk](https://www.ruby-forum.com/u/peterk)\
**Post date:** [March 3, 2006, 4:27pm UTC](https://www.ruby-forum.com/t/running-jruby/76195/2 "2006-03-03T16:27:38Z")

</div>

JRuby does not provide its own set of .rb libraries to run off; it  
expects that you will have C Ruby available somewhere. Obviously this  
allows us to run 90% of Ruby code and libraries exactly as C Ruby  
does, since we both use the same .rb files. I believe you have two  
options:

1. Try setting RUBY\_HOME to the base directory of your C Ruby install  
(i.e. where you would find bin, lib, and so on). The JRuby startup  
script should be able to see that location and use the .rb files  
directly.
2. If that fails to work (let me know!), you can simply copy the C  
Ruby .rb files into the JRuby distribution directory:

- copy %RUBY\_HOME%\lib\ruby\1.8 directory as a whole into  
%JRUBY\_HOME%\lib\ruby, so you have %JRUBY\_HOME%\lib\ruby\1.8  
containing all the same files.

The second method is how most of the JRuby dev team runs JRuby, and it  
works very well. It also keeps JRuby separate from your Ruby install,  
so if you move or rename it JRuby will continue to work. It does,  
however, require to you update those libraries if you install a newer  
Ruby version. In the future, we hope to work out a way to distribute  
JRuby with the standard Ruby .rb files, so it provides a complete,  
working Ruby interpreter out-of-the-box…but that’s a discussion for  
another day.

JRuby also has a user mailing list on [sf.net/jruby](http://sf.net/jruby), the jruby-user  
list. Please join us and let us know if you have any more problems.  
Thank you for trying JRuby!

---

<div class="post-metadata">

**Author:** ![peterk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/7993a0/32.png) [@peterk](https://www.ruby-forum.com/u/peterk)\
**Post date:** [March 3, 2006, 4:42pm UTC](https://www.ruby-forum.com/t/running-jruby/76195/3 "2006-03-03T16:42:46Z")

</div>

Sorry, that’s [JRuby download | SourceForge.net](http://sf.net/projects/jruby), and I should probably be plugging  
[jruby.sf.net](http://jruby.sf.net) instead, since that’s the official home page. Sorry for  
the mixup!
