how can I invoke a Java code?

Michael Ekstrand usenet at elehack.net
Thu Mar 22 20:53:34 EDT 2007


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



More information about the Python-list mailing list