JArray doesn't work
Status: Beta
Brought to you by:
devilwolf
Try this to reproduce the bug:
>>> from jpype import *
>>> a = JArray(JByte)
>>> a
<class 'jpype._jarray.byte[]'>
>>> b = a(10)
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "C:\Python25\Lib\site-packages\jpype\_jarray.py", line 73, in _jarrayInit
_JavaArrayClass.__init__(self, _jpype.newArray(self.__class__.__javaclass__, sz))
TypeError: argument 1 must be PyCObject, not None
Raising priority 'cause if I don't get this solved ASAP then I'll have to abandon using JPype and I'd REALLY like to use it, if it worked.
Boy do I feel dumb now! I forgot to do
startJVM(r"C:\java\jdk1.6.0_01\jre\bin\client\jvm.dll", "-ea")
before doing the steps above. I do this in my code all the time, but I forgot to do it in the interactive Python session.
It would be a big improvement to JPype if it gave an error message like "Must call startJVM first" if any other method is attempted before doing this.