0

I am using Python in Google App Engine and I have a Java class library that I want to use in my program...

Is there a way to import that library and use it in a python program?

I have searched the net and found something like this:

from jpype import *
import re
import string
startJVM("/opt/sun-jre/lib/i386/client/libjvm.so", "-Djava.class.path=/home/talat/zemberek-0.6.4.jar", "-ea")
zerisim = JPackage('net').zemberek.erisim.Zemberek

But I am not sure whether "jpype" can be used in Google App Engine...

Thank you,

2 Answers 2

1

If the java functionality is critical to your application and not easy to rewrite in python, then you could write a simple web app in java that uses the library, and run that on appengine as a separate version than your main python app. You could then call the java app from the python app using HTTP. This is not an elegant solution, but if you really need the functionality, it should get the job done. The key here is that app engine will let you run more than one "version" of your app at a time, including different runtimes.

Sign up to request clarification or add additional context in comments.

Comments

0

There is no way at present on App Engine to import or otherwise access Java libraries from Python. Jython might be an approach worth trying (using the Java GAE SDK), though I'm not aware of anyone having gone that route before.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.