In linux, configure JDK and PHP to call the java class-general Linux technology-Linux programming and kernel information. The following is a detailed description. Original: zhuzhu
For work purposes, you must configure PHP to call the java class in linux. I searched the internet and found a lot of information, but the system and JDK versions of each person are different. Therefore, debugging fails during configuration. After two days of installation and debugging, I finally got a lot of experience and lessons. It also reminds people who need PHP to call the java class.
Contact PHP and JAVA, of course, php-java-bridge.
System Environment: CentOs5.1 + apahe2.2.8 + PHP5.2.6
Jdk version: jdk-1_5_0_06-linux-i586.bin (rpm-ivh package name for. rpm packages)
Php-java-bridge: php-java-bridge_4.0.1.tar.gz
1. Install JDK
1. Make it executable: chmod + x jdk-1_5_0_06-linux-i586.bin, get jdk1.5.0 _ 06 (located under/usr/local)
Note: there cannot be spaces before and after "=. If there is a space, an error occurs during terminal connection:
-Bash: JAVA_HOME: command not found
-Bash: CLASSPATH: command not found
Modify the original export statement:
Export JAVA_HOME CLASSPATH PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
4. Test: # java-version
Output:
Java version "1.5.0 _ 06"
Java (TM) 2 Runtime Environment, Standard Edition (build 1.5.0 _ 06-b05)
Java HotSpot (TM) Server VM (build 1.5.0 _ 06-b05, mixed mode)
Indicates that the installation is successful.
Ii. Install javabridge
1. decompress:
Bz2 version: tar jvxf file.name.tar.bz2; gz version: tar zxvf file.name.tar.gz
I used tar.gz version: # tar zxvf php-java-bridge_4.0.1.tar.gz to get php-java-bridge_4.0.1
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.