php和java在同一个Web应用程序中

I have a php webapp that get Facebook posts through API and save them into db. Then I have a java application that read this posts from db, classify them and save classification out into db.

How can I call java application from my php script??

JavaBridge Could be a solution, but are there web hosts that allow to use it ??

Thanks for any suggestion.

P.S.

The Java part is a processes that should be started by the PHP process on demand and stops when its task ended