By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,180 Members | 1,149 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,180 IT Pros & Developers. It's quick & easy.

how can I invoke a Java code?

P: n/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.

Mar 23 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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
Mar 23 '07 #2

P: n/a
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.

Mar 23 '07 #3

P: n/a
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:
http://www.limsi.fr/Individu/pointal...ntautlang-java

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

Mar 23 '07 #4

P: n/a
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."
Mar 23 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.