Java connection (Anyone help?)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
stevieg
Forum Newbie
Posts: 4
Joined: Sun Nov 17, 2002 5:07 pm

Java connection (Anyone help?)

Post by stevieg »

Hi

I am attempted to include the java module in php. My environment is:

W2K SP3
C:\phpdev\Apache (ver 1.3.27)
C:\phpdev\php (ver 4.2.3)
C:\j2sdk1.4.0_02


The additional entries in php.ini include:

extension=php_java.dll


[Java]
java.class.path = ".\extensions\php_java.jar"
java.home = "C:\j2sdk1.4.0_02"
java.library = "c:\j2sdk1.4.0_02\jre\bin\server\jvm.dll"
java.library.path = "C:\phpdev\php\extensions"



I have test both php (with apache) and java in isolation and both work. However, running the following script:

<?php

$systemInfo = new Java("java.lang.System");

print "Total seconds since January 1, 1970:
".$systemInfo->currentTimeMillis();

?>


PRODUCES:

Fatal error: java.lang.NoClassDefFoundError: net/php/reflect in c:\phpdev\www\testarea\javetest1.php on line 3


Any ideas? Thanks for your time


Stevieg
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

you might try

Code: Select all

&#1111;Java]
java.class.path = ./extensions/php_java.jar
java.home = C:/j2sdk1.4.0_02
java.library = c:/j2sdk1.4.0_02\jre\bin\server\jvm.dll
java.library.path = C:/phpdev/php/extensions"
but it's only a guess
Post Reply