-下载 php-java-bridge_6.2.3_documentation.zip
https://netix./project/php-java-bridge/Binary%20package/php-java-bridge_6.2.3/php-java-bridge_6.2.3_documentation.zip
- 解压 php-java-bridge_6.2.3_documentation.zip
将其中的 JavaBridge.war 复制到相关目录里
- 执行 java -classpath JavaBridge.war TestInstallation
在 JavaBridge.war 所在的目录执行
- 将自己封装好的 jar 包复制到 /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.45.x86_64/jre/lib/ext
[root@localhost JavaBridge]# java -classpath JavaBridge.war TestInstallation
Starting a simple servlet engine: [/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.45.x86_64/jre/bin/java, -jar, /home/JavaBridge/ext/JavaBridge.jar, SERVLET_LOCAL:8080]
Mar 02 11:55:13 JavaBridge INFO : VM : 1.7.0_45@/
Mar 02 11:55:13 JavaBridge INFO : JavaBridge version : 6.2.3
Mar 02 11:55:13 JavaBridge INFO : logFile :
Mar 02 11:55:13 JavaBridge INFO : default logLevel : 3
Mar 02 11:55:13 JavaBridge INFO : socket : SERVLET_LOCAL:8080
Mar 02 11:55:13 JavaBridge INFO : java.ext.dirs : /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.45.x86_64/jre/lib/ext:/usr/java/packages/lib/ext
Mar 02 11:55:13 JavaBridge INFO : php.java.bridge.base: /root
Mar 02 11:55:13 JavaBridge INFO : thread pool size : 20
Mar 02 11:55:13 JavaBridge INFO : JavaBridgeRunner started on port INET_LOCAL:8080
Invoking php: [/usr/bin/php-cgi, -n, -d, allow_url_include=On, /home/JavaBridge/test.php]
Now check the /home/JavaBridge/RESULT.html.
Read the INSTALL.J2EE and/or INSTALL.J2SE documents.
- 修改 php.ini allow_url_include=On
- 所需的 jar 包
bcprov-jdk16-146.jar
- 包含 Java.inc
require_once("http://localhost:8080/java/Java.inc);
$java = new Java("Test");