how can I invoke a Java code?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • momobear

    #1

    how can I invoke a Java code?

    A friend of my write a Java program, and I want use it in my python
    program as a module. I searched the topic in Google and find maybe the
    better way is use GCJ to compile it. Is there any other way for me?
    the simple and speediness choice the better. thanks.

  • Michael Ekstrand

    #2
    Re: how can I invoke a Java code?

    On Thu, 22 Mar 2007 17:49:01 -0700, momobear wrote:
    A friend of my write a Java program, and I want use it in my python
    program as a module. I searched the topic in Google and find maybe the
    better way is use GCJ to compile it. Is there any other way for me? the
    simple and speediness choice the better. thanks.
    If you want to run the Java program as a separate process, you can run
    "java -jar TheProgram.jar" .

    If you're wanting to interact with the code, your best option may be
    Jython, an implementation of Python in Java.

    - Michael

    Comment

    • momobear

      #3
      Re: how can I invoke a Java code?

      If you're wanting to interact with the code, your best option may be
      Jython, an implementation of Python in Java.
      I do have to interact with Java module, and when talk about Jython,
      since I use third parts of python modules I am puzzled about it.

      Comment

      • Laurent Pointal

        #4
        Re: how can I invoke a Java code?

        momobear a écrit :
        A friend of my write a Java program, and I want use it in my python
        program as a module. I searched the topic in Google and find maybe the
        better way is use GCJ to compile it. Is there any other way for me?
        the simple and speediness choice the better. thanks.
        See my links:


        You can look at
        * Jython
        * JPype
        * JEP
        * java2python



        Comment

        • Jarek Zgoda

          #5
          Re: how can I invoke a Java code?

          momobear napisa³(a):
          A friend of my write a Java program, and I want use it in my python
          program as a module. I searched the topic in Google and find maybe the
          better way is use GCJ to compile it. Is there any other way for me?
          the simple and speediness choice the better. thanks.
          If the speed is crucial, I suggest compiling the Java code with GCJ,
          then write Python extension module for the Java library. This is how the
          Lucene indexing library is ported to Python, see
          http://pylucene.osafoundation.org/.

          --
          Jarek Zgoda

          "We read Knuth so you don't have to."

          Comment

          Working...