美文网首页
python java jpype

python java jpype

作者: yubooooooooo | 来源:发表于2020-03-27 13:06 被阅读0次

    环境 :

    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([]))
    

    相关文章

      网友评论

          本文标题:python java jpype

          本文链接:https://www.haomeiwen.com/subject/dujluhtx.html