need help with using java in PHP
| From: | Kevin Ison | Date: | Sat, 14 Jun 2003 16:16:36 +0000 |
| Subject: | need help with using java in PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-151493@lists.php.net to get a copy of this message | ||
ok heres the scenerio:
php.ini:
....
[Java]
java.class.path = C:\apache\php\JAVA\php_java.jar;c:\apache\htdocs\ktest\;.
java.home = C:\j2sdk1.4.1_01\bin\
java.library = C:\j2sdk1.4.1_01\jre\bin\server\jvm.dll
java.library.path = C:\apache\php\extensions\;C:\apache\php\;.\
the PHP source code:
<?
$myClass = new Java("java.io.file","c:\apache\logs\error.log");
if ($myClass->exists()) {
echo "File path is ".$myClass->getAbsolutePath()."<br/>";
} else {
echo "<br/> blah no workie <br/>";
}
?>
resulting output:
Warning: java.lang.ClassNotFoundException: java.io.file in
c:\apache\htdocs\ktest\xzerror.php on line 13
Fatal error: Call to a member function on a non-object in
c:\apache\htdocs\ktest\xzerror.php on line 23
I got the idea from something I saw a while back on a PHP tutorial.... my
question is, why doesnt this work. I think I have the PHP.INI file set up
correctly.
thanks
--
Kevin Ison
Charlotte, NC