# Error running .class generated by jrubyc

**URL:** <https://www.ruby-forum.com/t/error-running-class-generated-by-jrubyc/144020>\
**Category:** Ruby\
**Created:** [July 24, 2008, 6:13pm UTC](https://www.ruby-forum.com/t/error-running-class-generated-by-jrubyc/144020 "2008-07-24T18:13:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [July 24, 2008, 6:13pm UTC](https://www.ruby-forum.com/t/error-running-class-generated-by-jrubyc/144020/1 "2008-07-24T18:13:57Z")

</div>

Hello guys,

I have a ruby script that runs perfect from the command line using  
jruby.  
So I tried to compile it with jrubyc and the .class is now generated.

Then I proceed to run it with java -cp .:/pathto/jruby.jar classname and  
I  
receive the following error:

Exception in thread “main” search.rb:2:in `require’: no such file to  
load  
– rubygems (LoadError)  
from search.rb:2  
…internal jruby stack elided…

What am I missing?

Thanks,

Guillermo A.

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [July 24, 2008, 8:57pm UTC](https://www.ruby-forum.com/t/error-running-class-generated-by-jrubyc/144020/2 "2008-07-24T20:57:38Z")

</div>

Maybe you should post this to the JRuby ML rather than ruby-talk.

Robert

–  
[http://ruby-smalltalk.blogspot.com/](http://ruby-smalltalk.blogspot.com/)

There’s no one thing that’s true. It’s all true.

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [July 28, 2008, 9:35pm UTC](https://www.ruby-forum.com/t/error-running-class-generated-by-jrubyc/144020/3 "2008-07-28T21:35:32Z")

</div>

removed\_email\_address@domain.invalid wrote:

> ```
> from search.rb:2
> ...internal jruby stack elided...
> 
> ```

Basically you just need to specify where JRuby is located with the  
jruby.home property. Othewise it can’t find things like rubygems or Ruby  
stdlib.

java -Djruby.home=/path/to/jruby -cp .:/pathto/jruby.jar classname

- Charlie
