Install the JAVA environment in CentOS7.0 and centos7.0java Environment
Install the JAVA environment on CentOS7.0
Install JDK
1. Configure JDK Environment Variables
Upload the downloaded jdk(jdk-7u75-linux-x64.gz) file to the Reg:/home/p2pweb/java/directory (the directory can be customized)
[P2pweb @ iZ94q6gk846Z ~] # Tar-zxv-f jdk-7u75-linux-x64.gz // extract the compressed package
[P2pweb @ iZ94q6gk846Z ~] # Rm-rf jdk-7u75-linux-x64.gz // Delete package
[P2pweb @ iZ94q6gk846Z ~] # Mv jdk1.7.0 _ 75 jdk1.7 // rename
Enter:
1 [p2pweb @ iZ94q6gk846Z ~] # Vi/etc/profile
Press the "Page Down" file to the end, and enter the following content at the end of the document:
1 export JAVA_HOME =/home/p2pweb/java/jdk1.7.0 _ 05
2 export JAVA_BIN =/home/p2pweb/java/jdk1.7.0 _ 05/bin
3 export PATH = $ PATH: $ JAVA_HOME/bin
4 export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
5 export JAVA_HOME JAVA_BIN PATH CLASSPATH
Run the following command to make the modified profile take effect immediately.
1./etc/profile
Note: there is a space between. and/etc/profile.
2. verify whether the installation is successful.
Input: java-version
[P2pweb @ iZ94q6gk846Z ~] $ Java-version
Java version "1.7.0 _ 75"
Java (TM) SE Runtime Environment (build 1.7.0 _ 75-b13)
Java HotSpot (TM) 64-Bit Server VM (build 24.75-b04, mixed mode)
[P2pweb @ iZ94q6gk846Z ~] $
If the preceding result is displayed, the version is successfully installed.
Install Tomcat
1. Upload the downloaded Tomcat (apache-tomcat-7.0.59.tar.gz) file to the Reg:/home/p2pweb/java/directory (the directory can be customized)
[P2pweb @ iZ94q6gk846Z ~] # Tar-zxv-f apache-tomcat-7.0.59.tar.gz // extract the compressed package
[P2pweb @ iZ94q6gk846Z ~] # Rm-rf apache-tomcat-7.0.59.tar.gz // Delete package
[P2pweb @ iZ94q6gk846Z ~] # Mv apache-tomcat-7.0.59 tomcat7
2. start Tomcat
[P2pweb @ iZ94q6gk846Z ~] $ Cd/home/p2pweb/java/tomcat7/bin
[P2pweb @ iZ94q6gk846Z bin] $ ls
Bootstrap. jar daemon. sh startup. sh
Catalina. bat digest. bat tomcat-juli.jar
Catalina. sh digest. sh tomcat-native.tar.gz
Catalina-tasks.xml setclasspath. bat tool-wrapper.bat
Commons-daemon.jar setclasspath. sh tool-wrapper.sh
Commons-daemon-native.tar.gz shutdown. bat version. bat
Configtest. bat shutdown. sh version. sh
Configtest. sh startup. bat
[P2pweb @ iZ94q6gk846Z bin] $./startup. sh
Using CATALINA_BASE:/home/p2pweb/java/tomcat7
Using CATALINA_HOME:/home/p2pweb/java/tomcat7
Using CATALINA_TMPDIR:/home/p2pweb/java/tomcat7/temp
Using JRE_HOME:/home/p2pweb/java/jdk1.7.0 _ 75
Using CLASSPATH:/home/p2pweb/java/tomcat7/bin/bootstrap. jar:/home/p2pweb/java/tomcat7/bin/tomcat-juli.jar
Tomcat started.
If the preceding information is output, Tomcat is successfully installed.
Deployment Project Test
Upload the compiled java project in the/home/p2pweb/java/tomcat7/webapps directory to perform the test.
Reference blog: http://blog.sina.com.cn/s/blog_8ae0248601018fjl.html