|
From: Jeff E. <jem...@fr...> - 2007-08-19 20:02:29
|
>>> import java,jarray
>>> stringArrayType=java.lang.Class.forName('[Ljava.lang.String;')
>>> print jarray.array([["a b"], ["c d e"]],stringArrayType)
array([array(['a b'], java.lang.String), array(['c d e'], java.lang.String)], [Ljava.lang.String;)
bwgoudey wrote:
> I'm having trouble passing a String[][] to a java function. If I try passing
> it a python array of array of strings, ie [["a b"], ["c d e"]], I get the
> error "java.lang.IllegalArgumentException: Not a String or String[][]; got
> [['a b'], ['c d e']]". I had thought that lists and strings in python were
> supposed to be converted to their Java equivalent when needed but that does
> not seem to occur here. Perhaps I have to create my array using jarray but I
> am unsure how to use this for creating arrays of arrays. Does anyone have
> any ideas as to why I am unable to pass my object correctly?
>
> Thanks
|