PHP Tune Java interface

Source: Internet
Author: User

1, download the binary Javabridge.jar package, Java/java.inc library file,: http://php-java-bridge.sourceforge.net/pjb/download.php

2. Download the JDK package (360 software manager)

3. Run the command in the directory where the Javabridge.jar is located (CD first to the directory)

Java-jar Javabridge.jar servlet_local:8081 &

4. At the command line, enter Netstat-ano, and discover that a 8081 port has been turned on to start listening:

5. Place the Java.inc file in the Web directory and write the PHP test code test.php

<?php
Define ("Java_hosts", "127.0.0.1:8081");

Require_once "Java.inc"; PHP calls the Java interface, in the same directory as the script
Java_set_file_encoding ("UTF-8"); Set the Java encoding.

$props = Java ("Java.lang.System")->getproperties ();

$array = Java_values ($props);
Var_dump ($array);

PHP Tune Java interface

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.