bcdev / jpy

A bi-directional Python-Java bridge used to embed Java in CPython or the other way round.
Apache License 2.0
187 stars 37 forks source link

Python methods not being recongnized when calling them from a java object #182

Closed Klodovsky closed 3 years ago

Klodovsky commented 3 years ago

I've created a java object and tried to test if it can call any Python methods so I can proceed with importing other libs and do the task I'm willing to do, unfortunately none of the methods was being recongnized ( starting from the StartPython() method )and I didn't find a concrete example to follow.

here's a sample of my code (Coldfusion framework) I would appreciate any working example so I can understand the logic :

var jpy = createObject("java","org.jpy.PyLib");

if (!jpy.isPythonRunning()){ jpy.startPython() } try { jpy.print("Hello form Python");

} catch (JpyException e) {
  return("An error occurred: " + e.getMessage());
}

=> this returns The startPython method was not found.