note 22116 rejected from ref.java by torben
| From: | torben@php.net | Date: | Fri, 07 Jun 2002 09:15:15 +0000 |
| Subject: | note 22116 rejected from ref.java by torben | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-31554@lists.php.net to get a copy of this message | ||
I have PHP 4.2.0 and my config is:
./configure' '--prefix=/usr/local/apache' '--with-mysql=/usr/local/mysql'
'--with-apxs=/usr/local/apache/bin/apxs' '--with-imap'
'--enable-calendar' '--enable-sockets' '--enable-wddx' '--
with-ldap' '--enable-sigchild' '--enable-memory-limit'
'--enable-ftp' '--enable-debug=no' '--with-gd'
'--with-recode' '--enable-shared' '--with-jpeg-dir=/usr/local/lib'
'--with-png- dir=/usr/local/lib' '--with-zlib-dir=/usr/src/zlib'
'--with-ttf=/usr/lib' '--enable-gd-native-ttf' '--with-xml'
'--enable-ftp' '--with-java=/usr/lib/jdk1.1'
'--with-freetype-dir=/usr/local/lib'
in php.ini is:
[Java]
java.class.path = /usr/local/apache/lib/php/php_java.jar
java.home = /usr/lib/jdk1.1
java.library = /usr/lib/jdk1.1/lib/ia32/green_threads/libjava.so
java.library.path = /usr/lib/jdk1.1/lib/ia32/green_threads/
but when I try tu use Java get an error:
Fatal error: Unable to create Java Virtual Machine in /var/www/cs.sk/java_test.php on line 3
java.php:
<?php
// get instance of Java class java.lang.System in PHP
$system = new Java('java.lang.System');
// demonstrate property access
print 'Java version='.$system->getProperty('java.version').'
<br>';
print 'Java vendor=' .$system->getProperty('java.vendor').'
<br>';
print '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");
print $formatter->format(new Java('java.util.Date'));
?>
Please help me!
Thx