I set up a JavaBridge api over a Tomcat server. All right, it works well.
But I've got a specific need, I have Java classes to call from PHP and I haven't found any documentation about this.
Each java class is in a different file, do I have to include the files in a xml manifest or something like that ? Classes do have to be compiled or not ? (I think so but..)
Typically I would like to do :
<?php
import com.test.Test;
$obj=new Test();
?>
Thanks a lot.
EDIT (solved):
http://www.dsl.uow.edu.au/~sk33/php5java.htm
Tutorial very interesting.
- compile the java class and put it in a jar and thinking about the folders due to packages.
- Put the jar into the WEB-INF\lib folder
- Call the class
<?php require_once("java/Java.inc"); //java_require("Test.jar"); //Deprecated !!! $obj=new Java("com.test.Test"); echo $obj->getMessage(); ?>