Marshaling should do the trick:
jruby-1.6.7 :001 > a = [[1,2,3], [4,5,6]] => [[1, 2, 3], [4, 5, 6]] jruby-1.6.7 :002 > b = Marshal.load( Marshal.dump(a) ) => [[1, 2, 3], [4, 5, 6]] jruby-1.6.7 :004 > a == b => true jruby-1.6.7 :005 > b[0][0] = 15 => 15 jruby-1.6.7 :006 > a == b => false
source share