Well, I did following steps to call java class or methods or even simple output to my localhost
- I install java SE which is successfully working
- I check through CMD that my javac is working or not and it's working
- I also use to run Java/php bridge.war file using following command
java -classpath JavaBridge.war TestInstallation
works fine
But now when I am trying to execute following code:
<?php
require_once("java/Java.inc");
//echo java("java.lang.System")->getProperties();
require_once("first.java");
//require_once("apples.class");
//exec("java -version",$output);
//print_r($output);//return empty....:(
//$obj = new Java("apples.class");
?>
Expected output is:
Hello only
Coming output is following whole code of first.java file
class apples{ public static void main(String args[]) { System.out.println("Hello only"); } }
I don't know what to do? It's just simple java code but later on using more complex code.... first.java file code:
class apples{
public static void main(String args[])
{
System.out.println("Hello only");
}
}
Please help me in simple manner thanks.....in advanced:)