At 07:25 17.06.2003 -0400, Kevin Ison wrote:
Im trying to make calls to java classes and I keep getting class not found
errors... I got this idea from a tutorial.  I have the extensions
uncommented as well in the PHP ini file.

my set up follows:

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\;.\

ext/java configuration is a bit tricky, however something like the following should work:


[Java]
java.class.path = c:\php\extensions\php_java.jar
java.home = c:\j2sdk1.4.1_01\jre
java.library = c:\j2sdk1.4.1_01\jre\bin\client\jvm.dll
java.library.path = c:\php\extensions\

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 1
Fatal error: Call to a member function on a non-object in
c:\apache\htdocs\ktest\xzerror.php on line 2


anything obvious i am missing?

AFAIR java is case sensitive :) try: $myClass = new Java("java.io.File","c:\\apache\\logs\\error.log");

mit freundlichen grüßen aus berlin,
daniel

/*--
Daniel Beulshausen - [EMAIL PROTECTED]
Using PHP on Windows? http://www.php4win.com



-- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to