Execute java class in PHP

后端 未结 4 1927
眼角桃花
眼角桃花 2021-01-16 01:50

I want to call a java program and fetch it\'s output in stdout. I followed the suggestions in stackoverflow. But it doesn\'t work.

I have add the class file to my C

4条回答
  •  北海茫月
    2021-01-16 02:28

    I would recommend using Java/PHP Bridge found here: http://php-java-bridge.sourceforge.net/pjb/ It's quite easy to install and works very well.

    Also, I recommend using the following link to download it. (it's the same one as the link in downloads->documentation)

    http://sourceforge.net/projects/php-java-bridge/files/Binary%20package/php-java-bridge_6.2.1/php-java-bridge_6.2.1_documentation.zip/download

    The file is JavaBridge.war. You'll probably want to use Tomcat for the Java EE container. Once Tomcat is set up, you just put this file in the webapps folder and it's installed.

    If you want to regularly use java classes in PHP this is the best method I know of and I have tried a lot of them. Resin also worked, but it didn't play nice with my mail server.

提交回复
热议问题