I need to run a single java program (which will change the content of some text files) on my new website. What's the easiest way to do that for example using php code? Do I need to install JVM or any other software in order for this to work? Please guide on how to do this step by step if possible.
You have to install a Java Runtime Environment (JRE) on your server to be able to run a java program.
http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html
To execute a java program in php, you can simply use the exec()
function :
exec("java -jar yourProgram.jar");