Setup
Py4J enables Python programs running in a Python interpreter to dynamically access Java objects in a Java Virtual Machine.
Methods are called as if the Java objects resided in the Python interpreter and Java collections can be accessed through standard Python collection methods.
Py4J also enables Java programs to call back Python objects. Py4J is distributed under the BSD Python 2.7 -to- 3.x is supported to use you will need the py4j lib in your python application.
https://pypi.org/project/py4j/
More info here: https://www.py4j.org/