I followed following phpjavaBridge to communicate from php to java, working fine if .jar(java program is running on local host (if both php and java are on same machine)). But my requirement is that java file is running on different machine and php on other, how should I communicate them, Let me explain, what I am doing, Request is send from web page(php) to a java program (would be running on remote machine) through php/java Bridge to perform a task, some parameters are passed from php to java, after completing task, java program return's back some parameters to php, this is working fine if java program and web are on same machine,but I want to run java file on other machine
I would suggest you to use deployJava.js
to run .jar file in php.
What actually deployJava.js do? : deployJava.js will run your .jar file in php as applet. You can run .jar file in php or html using applet. deployJava.js will help you to pass parameters in .jar file and retrieve events returned from java program.
I have used to run remote .jar file as applet in html file using deployJava.js.
Example Code Snippet :
<script src="deployJava.js"></script>
<script type="text/javascript">
var attributes = { id:'peers', code:'net.sourceforge.peers.javascript.JsUserAgent', width:1, height:1} ;
var parameters = {jnlp_href: 'applet-tests.jnlp'} ;
deployJava.runApplet(attributes, parameters, '1.6');
</script>
Thanks.