function get()
 {
     echo "hello Java Handler here";
     $CA = new Java("calculator.CalculatorBean");
     $session = java_session();
     if (is_null(java_values($calcinstance = $session->get("calculatorInstance")))) {
         $session->put("calculatorInstance", $calcinstance = new Java("calculator.CalculatorBean"));
     }
     echo "<br>after calcultator";
     echo "<br>session from java = " . java_values($calcinstance = $session->get("calculatorInstance"));
     if (eregi('^/java/rpc/*', $_SERVER['REQUEST_URI'])) {
         $RPC = new Java("rpc.test.RpcConsumer");
         $RPC->test();
         echo "<br> RPC Service on 8082 ";
     }
 }
session_start();
?>

<?php 
echo "hello";
//java_require("/usr/lib/jvm/java-7-openjdk-i386/jre/lib/ext/calculator.jar");
//require_once("java/Java.inc");
require_once "http://127.0.0.1:8081/JavaBridge/java/Java.inc";
echo "hello1.5";
java_require("calculator.jar");
//java("demo.rfc.test.RpcConsumer")->main();
java_require("demo.jar");
$CA = new Java("calculator.CalculatorBean");
//$RC = new Java("calculator.test.RpcConsumer2");
$RC = new Java("demo.rpc.test.RpcConsumer2");
$RC->test();
$session = java_session();
if (is_null(java_values($calcinstance = $session->get("calculatorInstance")))) {
    $session->put("calculatorInstance", $calcinstance = new Java("calculator.CalculatorBean"));
}
echo "hello2";
$result = 0;
$opr = "none";
$term_1 = 0;
$term_2 = 0;
if (isset($_POST['operationName'])) {
    $opr = $_POST['operationName'];
}
if (isset($_POST['term1Name'])) {
    $term_1 = $_POST['term1Name'];
}
Beispiel #3
0
#!/usr/bin/php

<?php 
include_once "java/Java.inc";
$here = realpath(dirname($_SERVER["SCRIPT_FILENAME"]));
if (!$here) {
    $here = getcwd();
}
$testvar = new Java('Array6');
$testobj = $testvar->test();
echo $testobj[0][0][0][0][0][1];
echo $testobj[0][0][0][0][1][0];
echo $testobj[0][0][0][1][0][0];
echo $testobj[0][0][1][0][0][0];
echo $testobj[0][1][0][0][0][0];
echo $testobj[1][0][0][0][0][0];
echo "\n";