环境 :
python 3.6.8
jpype 0.7.2
pip install jpype1
App.java
package plugin;
public class App {
public static void main(String[] args) {
System.out.println("Hello World!!!!!!");
}
}
test.py
import jpype
from jpype import *
JVM_PATH = jpype.getDefaultJVMPath()
CLASS_PATH = ('/project1/plugin.jar')
EXT_PATH = ('/project1/dependency/*')
jpype.startJVM("-ea", "-Xms64m", "-Xmx64m", **{"jvmpath":JVM_PATH, "classpath":[CLASS_PATH, EXT_PATH]})
test = jpype.JPackage("plugin").App()
print(test.main([]))
网友评论