First, install the JDK7
1. Download JDK7 from Oracle to the CentOS desktop: jdk-7u71-linux-x64.rpm
2. Copy it to the/usr directory:
CP '/home/shenzhun/desktop/jdk-7u71-linux-x64.rpm '/usr/
3. Enter the/usr directory and give it permission to run the installation:
Cd/usr
chmod 777 jdk-7u71-linux-x64.rpm
RPM-IVH jdk-7u71-linux-x64.rpm
Run:
4. Configure Environment variables:
Vi/etc/profile
Append the following content:
Export java_home=/usr/java/jdk1.7.0_71
Export classpath=.: $JAVA _home/jre/lib/rt.jar: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Export path= $PATH: $JAVA _home/bin
5. Remove the default installed JDK:
Rpm-qa|grep JDK
Yum-y Remove Java Java-1.6.0-openjdk-1.6.0.0-1.24.1.10.4.el5
Results:
6. Run Javac, Java, and java-version to verify that the JDK7 is installed successfully.
Second, installation TOMCAT7
1. Go to Apache download apache-tomcat-7.0.57.tar.gz to Desktop
2. Unzip the tar zxvf apache-tomcat-7.0.29.tar.gz
3. Move the directory to/tomcat: MV '/home/shenzhun/desktop/apache-tomcat-7.0.57 '/tomcat
4. Rename to TOMCAT7:MV APACHE-TOMCAT-7.0.57/TOMCAT7
5. Enter the Tomcat7/bin directory and run "sh startup.sh" or "./startup.sh" to start Tomcat:
CentOS Install JDK7 and Tomcat