After reading some of the posts in this website related to exactly the same issue I\'ve got, I found that none of them were giving me a successful result:
How to run a j
You have to do something like this:
//REPLACE THIS PATH WITH THE REAL JAVA PATH
$handle = popen(`"C:\\Program Files (x86)\\Java\\jre7\\bin\\java.exe arguments"`, "r"));
//You can read with $read = fread($handle, 2096)
pclose($handle);
exec will not work on Windows (for "external" executables) and in most cases you'll have to provide the full path to Java.