I am new to both PHP and Java. Currently I am working on a project which call java class and its methods in the PHP code. I am creating a proof of concept for this. The problem is I am not able to connect custom class I have created in java. More over it could be said I don''t know how to do it. I have used java.inc and javabridge.jar files to connect to the system classes but not able to connect to a simple class. The step I have followed is:
Created a java package, class called clsForPHP and it has a method sum() which takes 2 parameters and returns integer value. (This is created using MyEclipse IDE) Now I am trying to call this function from PHP. I have copied the jar file containg the package to PHP project. (Eclipse- Helios is the IDE)$d= new java("clsForPHP.class");
Please help!! I have searched a lot but couldn''t able to find a proper solution. What I think is this package should be added in the java.inc file but I don''t know how to do it. I am setting this in my local system which uses Win7 as OS and this for POC purpose.
解决方案
d= new java("clsForPHP.class");
Please help!! I have searched a lot but couldn''t able to find a proper solution. What I think is this package should be added in the java.inc file but I don''t know how to do it. I am setting this in my local system which uses Win7 as OS and this for POC purpose.
Refer to this link