rjb `import': can't create Java VM (RuntimeError) from app/java/test.rb:4:in `<main>'

1.2k Views Asked by At

I'm trying to import java code in my rails application.

but when I include a 'rjb' gem in my gem file and write a simple test code,

it shows this problem:

`import': can't create Java VM (RuntimeError)
from app/java/test.rb:4:in `<main>'

my test.rb file is:

require 'rjb'

puts "access java.util.UUID via RJB"
puts Rjb::import('java.util.UUID').randomUUID().toString()

I don't know what to do now.. Any help will be immensely appreciated. Thank you in advance!

1

There are 1 best solutions below

0
On

There is some information in the top "jvm is required" section at:

http://rjb.rubyforge.org/

...that might help you.

What OS are you running? Do you have a JVM installed?

-- Keith