PHP and JAVA are very powerful programming tools and their extension libraries are also very useful. this tutorial mainly describes how to use PHP to call a powerful JAVA Class Library (classes ). For your convenience, this tutorial will include JAVA installation and some basic examples. In windows, the first step is to install JDK, which is very easy. you only need to go back to PHP and JAVA
JAVA is a very powerful programming tool and its extension Library is also very useful. this tutorial mainly describes how to use PHP to call a powerful JAVA Class Library (classes ). For your convenience, this tutorial will include JAVA installation and some basic examples.
Installation in windows
Step 1: install JDK. this is very easy. you only need to press enter to install JDK. Perform the following steps.
Add "PATH = % PATH %; C: \ jdk1.2.2 \ bin" to the AUTOEXEC. BAT file under Win9x.
Add "; C: \ jdk1.2.2 \ bin" under NT/Win2000 to the environment variable.
This step is very important, so that PHP can correctly find the JAVA class to be called.
In [java], set java. class. path to point to php_java.jar. if you use the new JAVA class, you should also store the path. In this example, we use the c: \ myclasses directory.
Step 3: Create the following php file in the Test environment:
$ System = new Java ("java. lang. System ");
Print "Java version =". $ system-> getProperty ("java. version"). "\ n ";
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.