require "rjb" Rjb::load class TestIter def initialize() end def hasNext() false end def next() false end end class ThrowSample def do_throw begin Rjb::throw('java.lang.NoSuchException', 'test') rescue RuntimeError => e # nothing end end def do_bind it = TestIter.new it = Rjb::bind(it, 'java.util.Iterator') #-> NoClassFoundException it.hasNext() end end t = ThrowSample.new t.do_throw t.do_bind