Code: Select all
//test.php
<?php
require_once("java\Java.inc");
$systemInfo = new Java("Test");
print $systemInfo->foo();
?>Code: Select all
//test.java
class Test
{
public void foo()
{
System.out.println("hello php");
}
}Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: CreateInstance failed: new Test.
If I use a standard class like below. It works -
Code: Select all
<?php
require_once("java\Java.inc");
$systemInfo = new Java("java.lang.System");
print "Total seconds since January 1, 1970:
".$systemInfo->currentTimeMillis();
?>1) Should I copy my class to the standard location where all Java classes are kept. (What is this location?)
2) Do some changes in the php.ini file