0

I created a JAR file and i need to call its methods from a Php file. I tried doing it with Php-java bridge but, it works only with sun java 6 which is an abandoned version. Also, i feel that using php-java bridge is not the best way of achieving what i want as it was updated ages ago. Are there any other methods which i can follow to call my java functions from a php file?

yAsH
  • 3,367
  • 8
  • 36
  • 67

2 Answers2

0

Execute your java programm from PHP with shell_exec(comand to start your java programm), it will return you the output from your java programm as string. http://www.php.net/manual/en/function.shell-exec.php

Sir l33tname
  • 4,026
  • 6
  • 38
  • 49
0

See Run Java class file from PHP script on a website.

In a nutshell: Use PHP's exec() function. It needs to be done very carefully, as described in the referenced issue, but if you do it right, (I've found) it can be a cleaner solution than the bridge method.

Community
  • 1
  • 1
exxodus7
  • 562
  • 1
  • 9
  • 27