在PHP中嵌入Java [重复]

Possible Duplicate:
Call Java method from PHP5

For a time now, I've been searching on how to embed java in php but found questions that give possible solutions and others that say it's impossible.

I happen to have some java code working and I need it working in a php application, I tried making the same exact code in php language (of course, in php) but it doesn't work, so, what I want to know is:

How can I run my java functions using php?

Thank you all.

You should ask yourself what the right technology, architecture and programming language for your actual problem is and how it relates to your overall strategy especially regarding skills. You should use the "right" tools for a given problem while trying to limit your skills to a set of tools that are suitable to solve a large scale of your problems. If you need PHP for certain web features in your case you could investigate calling Java server functions e.g. via REST or other communication technologies.

You can give a try to PhpJavaBridge I use it on a project, you can call methods for example from PHP to Java.

But we do that because we got 2 different server, if you got the choice just use one techno.