开发者

Is it possible to access java class libraries from a python program in Google App Engine?

开发者 https://www.devze.com 2023-04-06 23:52 出处:网络
I am using Python in Google App Engine and I have a Java class library that I want to use in my program...

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 *
impo开发者_开发技巧rt 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,


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号