user3302257
user3302257

Reputation: 79

Execute java class from php

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?

Upvotes: 1

Views: 632

Answers (2)

Sverri M. Olsen
Sverri M. Olsen

Reputation: 13263

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.

Upvotes: 2

Jonan
Jonan

Reputation: 2536

Use the exec() function:

exec("java Main.class");

Upvotes: 0

Related Questions