From: <php...@li...> - 2006-06-12 18:41:59
|
Hi, > package jl; > public class phptest{ ... > public String test(String str) { ... > if i write "java_require("c:/phptest.jar"); $tf =new > Java("jl/phptest");",,,it shows error. > > how can i write it? In PHP/Java Bridge version 3.0.8: jar tvf c:/phptest.jar should display: jl/phptest META-INF/MANIFEST.MF The PHP code may look like: java_require("c:/phptest.jar"); $tf = new Java("jl.phptest"); $tf->test("hello"); In PHP/Java Bridge 3.1.0 you can convert the java library into a PHP class and require it: convert your java library /libraries to PHP code: java -jar JavaBridge.jar --convert c:/php5/pear c:/phptest.jar The above command creates the PHP class jl_phptest in c:/php5/pear/phptest/: <?php /* ini_set("include_path", "c:/php5/pear"); */ require_once("phptest/jl_phptest.php"); $tf = new jl_phptest(); $result = $tf->test("hello"); echo "$result"; ?> Regards, Jost Boekemeier __________________________________________________ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com |