Stack Overflow Asked by Pritiraj on December 13, 2021
I need to use HashMap
in Python code.
I am writing this line in Pycharm, using Python:
jhash = java.util.HashMap
I have imported like this:
import jpype
from jpype import java
from jpype import javax
But i am getting below error:
Traceback (most recent call last):
File "C:/PythonCode/JMX.py", line 11, in <module>
jhash = java.util.HashMap()
TypeError: Package `java.util.HashMap` is not callable.
Even with this little code I could reproduce the error. In my opinion you didn't start JVM. This code works fine for me.
import jpype
from jpype import java
jpype.startJVM()
jhash = java.util.HashMap()
jhash.put("A","B")
print(jhash)
Answered by tifi90 on December 13, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP