-1

I have java application on windows , that contains lot of .class files(so I cant see the name of the function and what they do).

I want to invoke to apply 1 function from outside of the application while the application I running (I prefer do it on python).

I search so much but not found any way to do it.

is that passable?

ARMisKing
  • 1
  • 1
  • Using java combined with python is possible, see eg. [link](https://stackoverflow.com/questions/3652554/calling-java-from-python), but this starts another instance of the jvm. To my knowledge it is impossible for a running program A to directly call a function in an already running program B, since this would violate memory-access constraints. – Poohl May 14 '18 at 20:06
  • Yes, I know I can start the application, buy I want to invoke to specific function – ARMisKing May 14 '18 at 20:07
  • Well, as i said: If all you want to do is invoke a java-function from python take a look at [this thread]( https://stackoverflow.com/questions/3652554/calling-java-from-python), this is exactly the problem someone else faced there. – Poohl May 14 '18 at 20:26

1 Answers1

0
from py4j.java_gateway import JavaGateway
gateway = JavaGateway()                        # connect to the JVM
java_object = gateway.jvm.mypackage.MyClass()  # invoke constructor
other_object = java_object.doThat()

referance : Calling Java from Python

Idan Str
  • 614
  • 1
  • 11
  • 33