I am using JPype in Python so I can call Java functions. I am having trouble importing my own jar files.
I have this jar: /home/di/eclipse_plugins/plugins/org.eclipse.birt.report.engine_4.2.1.v20120820.jar
In the org.eclipse.birt.report.engine.api
package there is a EngineConfig
class definition. I am trying to instantiate and use this class I have in that jar. In regular Java this is what I would have:
import org.eclipse.birt.report.engine.api.EngineConfig;
EngineConfig config = new EngineConfig();
config.setLogConfig("/home/di/logs");
I have this in Python:
import jpype
from jpype import *
jvmPath = jpype.getDefaultJVMPath()
jpype.startJVM(jvmPath, "-Djava.class.path=/home/di/eclipse_plugins/plugins/*.jar")
engineConfig = JPackage("org").eclipse.birt.report.engine.api.EngineConfig
engineConfig.setLogConfig("/home/di/logs")
jpype.shutdownJVM()
However, when I run this, I get this error:
Traceback (most recent call last):
File "test.py", line 15, in <module>
engineConfig.setLogConfig()
File "/usr/lib64/python2.6/site-packages/jpype/_jpackage.py", line 53, in __call__
raise TypeError, "Package "+self.__name+" is not Callable"
TypeError: Package org.eclipse.birt.report.engine.api.EngineConfig.setLogConfig is not Callable