在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.
可能重复: strong>
从PHP5调用Java方法 p> blockquote> \ n一段时间以来,我一直在寻找如何在php中嵌入java但是找到了可以提供解决方案的问题,而其他人则认为这是不可能的。 p>
我碰巧有 一些java代码工作,我需要它在PHP应用程序中工作,我尝试在PHP语言(当然,在PHP)中制作相同的确切代码但它不起作用,所以,我想知道的是: p >
如何使用php运行我的java函数? p>
谢谢大家。 p> div>
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.