Install JDK 7, Tomcat 7, and JDK 7 in Linux.
In Java Web development, JDK and Tomcat are essential. Next, let's share the simple installation method of Jdk and Tomcat on Linux.
Environment:
1. Operating System: CentOS 6.5X64 (64-bit)
2) Tomcat: tomcat-7.0.52
3. JDK: jdk-7u51-linux-x64 address: http://www.hpboys.com/607.html
Install
1. Download
Tomcat: tomcat-7.0.52 tomcat-7 List ~
Jdk: jdk-7u51-linux-x64 jdk list ~
Select the corresponding program download in the list above.
2. Extract
- Tar zxvf jdk-7u51-linux-x64.tar.gz
- Tar zxvf apache-tomcat-7.0.52.tar.gz
3. Install
- Mkdir/usr/local/java/
- Mv jdk1.7.0 _ 51 // usr/local/java/
- Mv apache-tomcat-7.0.52/usr/local/
In fact, tomcat and jdk do not need to be installed. You only need to decompress the package, copy it to the corresponding directory, and set the environment variable.
4. Set Environment Variables
Edit/etc/profile and add content at the bottom
- # Java settings
- JAVA_HOME =/usr/local/java/jdk1.7.0 _ 51 (PS: based on your current path and Version)
- Export JAVA_HOME
- PATH = $ JAVA_HOME/bin: $ PATH
- Export PATH
- CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
- Export CLASSPATH
- # Tomcat settings
- CATALINA_HOME =/usr/local/apache-tomcat-7.0.52 (PS: changed based on your current path and Version)
- Export CATALINA_HOME
OK. After the modification, run the following command to make the system environment take effect.
- Source/etc/profile
5. start tomcat
- /Usr/local/apache-tomcat-7.0.52/bin/startup. sh
The following startup prompt is displayed:
- Using CATALINA_BASE:/usr/local/apache-tomcat-7.0.52
- Using CATALINA_HOME:/usr/local/apache-tomcat-7.0.52
- Using CATALINA_TMPDIR:/usr/local/apache-tomcat-7.0.52/temp
- Using JRE_HOME:/usr/java/jdk1.7.0 _ 51
- Using CLASSPATH:/usr/local/apache-tomcat-7.0.52/bin/bootstrap. jar:/usr/local/apache-tomcat-7.0.52/bin/tomcat-juli.jar
- Tomcat started.
Now you can access your website through IP Address: 8080. You will see a yellow kitten, which is your Java web environment.
Note: If the access fails, check whether your firewall port has been added with port 8080,
- # View firewall ports
- Service iptables status
-
- # Check whether Tomtcat is in the process
- Ps-ef | grep tomcat
At last, the Tomcat homepage is attached.