#63 JArray doesn't work

Version 0.5

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


  • C. Martin Taylor

    • priority: 5 --> 9
  • C. Martin Taylor

    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.

  • C. Martin Taylor

    • priority: 9 --> 1
    • status: open --> open-invalid
  • C. Martin Taylor

    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.


Log in to post a comment.