rubyjrubyrjb

How to kill JVM loaded by Ruby-Java Bridge (Rjb)


Is this possible? How?


Solution

  • I used VisualVM to detect the presence or absence of the JVM, and found that Rjb::unload works. However, when I try reloading the JVM, it fails. Here's the irb session that shows this:

    āžœ  ~  irb --prompt simple
    >> require 'rjb'
    => true
    >> Rjb::load
    => nil
    >> Rjb::unload
    => 0
    >> Rjb::load
    RuntimeError: can't create Java VM
        from (irb):4:in `load'
        from (irb):4
        from /Users/kbennett/.rvm/rubies/ruby-1.9.3-p392/bin/irb:16:in `<main>'
    >> 
    

    -- Keith


    http://about.me/keithrbennett