Hello,
I would like to explain some configuration to run PHP/Java Bridge in Wamp Server. Whenever you tried to run, you will get the following error message which is because of version confict between PHP and PHP\JavaBridge.
==========================
Fatal error: java() [<a href='function.java'>function.java</a>]: Unable to load Java Library jvm.dll, error
==========================
Therefore, I advise you to use the php version to 5.1.0 and php-java-bridge_3.2.1 which can be downloaded from <a href="[
sourceforge.net];.
Once you have downloaded, follow the instruction below:
1. extract the zip file and then you will see ext folder inside
2. copy (ext\JavaBridge.jar, ext\php_java.dll) files and paste to C:\wamp\bin\php\php5.1.0\ext
3. restart the wamp server
4. run the following code
============================
<?php
// get instance of Java class java.lang.System in PHP
$system = new Java('java.lang.System');
// demonstrate property access
echo 'Java version=' . $system->getProperty('java.version') . '<br />';
echo 'Java vendor=' . $system->getProperty('java.vendor') . '<br />';
echo 'OS=' . $system->getProperty('os.name') . ' ' .
$system->getProperty('os.version') . ' on ' .
$system->getProperty('os.arch') . ' <br />';
// java.util.Date example
$formatter = new Java('java.text.SimpleDateFormat',
"EEEE, MMMM dd, yyyy 'at' h:mm:ss a zzzz"
;
echo $formatter->format(new Java('java.util.Date'));
?>
==================================
You will see the following result successfully:
=================
Java version=1.6.0_01
Java vendor=Sun Microsystems Inc.
OS=Windows Vista 6.0 on x86
Tuesday, November 27, 2007 at 12:52:51 PM Singapore Time
===================
Enjoy it,
Thuyain (Myanmar)