1

I want to execute some java class for doing some bacground work,(have no any ui related task).like file read, write in a specific location. My main server side is done by php. I want to call these java program from php file. I study about Java/PHP Bridge. But i could not understand what i have to use like jse program(not suitable in server),jsp application (have no gui), or by a ejb. Please tell me what will be the best option to do that?

1
  • 1
    You could perhaps invoke the Java application like any command-line command in the PHP code. Commented Sep 1, 2014 at 18:17

2 Answers 2

2

You can execute a program in a couple of ways:

Which one to use depends on what you want. You should study the above links and figure out which one to use.

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

Comments

0

Use the exec() function:

exec("java Main.class");

1 Comment

I try it keeping .java class file in a jse project and in same folder in php project but not work. @Jonan

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.