RJB jave bridge help!

Why is this happening?
if i put my Rjb::load method in environment.rb webrick won’t start
from inside radrails it just sits there trying to connect… however i
can start webrick manually by doing script/server in a terminal
window.

i saw some code where instead of having the load method in
environment.rb they put it in the model that uses it… decided to try
this, but when i put it in there either inside a ‘connect’ class
method or just floating inside the body of the class i get the error
‘can’t create Java VM’…

where does the Rjb::load method go? i left the require in
environment.rb (but i did try moving it out of desperation trying to
get things to work)…

any help would be majorly appreciated

I would suggest take this to a JRuby forum. I would guess most people
here are not running Ruby inside the JVM. I could be wrong. I just
imagine you’ll get better help from the JRuby guys.

I ran into a similar problem in Windows. It doesn’t detect the
JAVA_HOME
environment variable. I added the following above the Rjb::load line:

ENV[‘JAVA_HOME’] = ‘C:\Program Files\Java\jdk1.6.0’ if
ENV[‘JAVA_HOME’].nil?

  • Stephen

Ahhhh! yes the JAVA_HOME wasn’t getting passed on! thank you so much…
i’m not on windows, but the ENV[‘JAVA_HOME’] check failed so i did
like you suggested (but with linux path). funny thing is that it would
work fine when i did script/server in the terminal, but trying to
start the server in radrails kept giving me the ‘can’t start Java
VM’…

thanks a bunch…

On May 1, 1:42 pm, “Stephen G.”