1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Calling Java from Python

Discussão em 'Python' iniciado por Stack, Julho 16, 2025.

  1. Stack

    Stack Membro Participativo

    What is the best way to call java from python? (jython and RPC are not an option for me).

    I've heard of JCC: http://pypi.python.org/pypi/JCC/1.9 a C++ code generator for calling Java from C++/Python But this requires compiling every possible call; I would prefer another solution.

    I've hear about JPype: http://jpype.sourceforge.net/ tutorial: http://www.slideshare.net/onyame/mixing-python-and-java

    import jpype
    jpype.startJVM(path to jvm.dll, "-ea")
    javaPackage = jpype.JPackage("JavaPackageName")
    javaClass = javaPackage.JavaClassName
    javaObject = javaClass()
    javaObject.JavaMethodName()
    jpype.shutdownJVM()


    This looks like what I need. However, the last release is from Jan 2009 and I see people failing to compile JPype.

    Is JPype a dead project?

    Are there any other alternatives?

    Continue reading...

Compartilhe esta Página