Reputation: 3
I want to make a web application for books using java servlets with Tomcat. I want to import some code (that reads *.epub
, *.pdf
, *.doc
, *.mobi
, and *.txt
files) from the project Calibre into my project, if it's possible.
Calibre source: http://bazaar.launchpad.net/~kovid/calibre/trunk/files Some source from this link I want to work into my project.
Application Calibre is an open source written in Python and C. What I want is to import sources written in python (.py
), which allows me to read standard epub, pdf, txt ... in my project developed in java servlet to view and to convert the books. I using Eclipse(Java EE) and I do not know what steps to import these sources and how to make. It must to export these source to jar?
Upvotes: 0
Views: 422
Reputation: 5097
Python and java are different languages. You cannot have java code call python code or the other way round without some sort of conversion. I think your best option is to either
Sure there are ways to call python from java, but it'll be rather hard to apply them to something as big Calibre, which also uses some C.
Upvotes: 0
Reputation: 91119
I see two other ways:
You could work with Jython (but I have no experience with that and don't know if it solves your problem)
You could write a JNI module for Java which in turn starts and uses the Python interpreter.
Upvotes: 0
Reputation: 41858
Python isn't compatible with Java, in that Java can't run python code.
But, there are a couple of options.
Upvotes: 1