- 论坛徽章:
- 0
|
本帖最后由 hq22 于 2012-06-20 16:17 编辑
php
<?php
//require_once("http://localhost:8080/JavaBridge/java/Java.inc");
require_once("Java.inc");
$test = new Java("Test");
$test->setName("Hello php java");
echo $test->getName();
echo "<br />";
echo $test->add(12,13);
?>
java
public class Test
{
private String name = "";
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return this.name;
}
public float add(float num1, float num2)
{
return num1 + num2;
}
}
可是每次127.0.0.1/test.php总是找不到Test的类,要把test.class放到哪里去?或者怎么设置?
java -jar JavaBridge.jar方式启动服务端 |
|