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?

1
  • 3
    Couple methods: 1. Wrap your JAR in a REST/Soap web service, 2. Use RPC, 3. Use php exec Commented Mar 26, 2013 at 14:09

2 Answers 2

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

Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.