It took me a while to find this as well. I think I eventually got my answer from the JRuby Cookbook pages on the wiki.
Anyway, try this:
["a", "b", "c"].to_java(:String)
The parameter you give to to_java is the Java type you want the Java array to be.
On 11/18/07, Scott Davies <scottd@xxxxxxxxx> wrote:
Simple JRuby newbie question: how do you create a Java array of a
particular Java type in JRuby? I haven't seen any mention of this in
the docs I've managed to find, and trying to search over the mailing
list archive on Codehaus currently makes the site barf ("application
error").
Thanks,
-- Scott
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email