Page 1 of 1

php-java bridge configuration

Posted: Tue Feb 19, 2008 8:46 am
by m_kk
Hello,

I am sure people here might have heard about php-java bridge. I want to use this to call a java function (Standalone) from php page. I just need to install the standalone version of this but the documentation in various parts of internet is confusing. Can any one have simple steps to install just the standalone version (no tomcat or any j2ee container) of php-java bridge on Ubuntu and Centos machines?.

I have apache2.2 with php 5.2.3 running.

Thanks you in advance.

Re: php-java bridge configuration

Posted: Tue Feb 19, 2008 5:02 pm
by m_kk
Any one had an idea about this?

Re: php-java bridge configuration

Posted: Tue Feb 19, 2008 5:15 pm
by Chris Corbyn
I've set it up without a container before. It was a pain. But generally speaking, the php.ini settings are relatively clear.

I no longer work for the company whom I set all this up for so I don't have the config to hand I'm afraid. From what I remember, you only need the path to the JRE in php.ini, and the classpath can be defined from within your code.

When you say "call a function (Standalone)" are you referring to the use of:

import static com.project.ClassName.staticMethod;

?

I'm not too sure the java bridge will allow that. You'd have to import the class and then invoke a static method on it. Come to think of it, I don't particularly recall how the java bridge handles static class methods.

I can tell you one thing... we ended up dropping it in the end. It was far too buggy (maybe 7 months ago). We were trying to get Jasper reports working with it (partly out of curiosity) but it was just no good. It made PHP segfault heaps :?

Re: php-java bridge configuration

Posted: Wed Feb 20, 2008 8:23 am
by m_kk
Oh thanks for the heads up. You saved me some time.

I need to call a function in java class by passing a parameter to the method. I am not dealing with static methods just plain objects. If not java bridge do you know if there is any other implementation? I heard there is one involving Web services