Install JDK 7, Tomcat 7, and JDK 7 in Linux.

Source: Internet
Author: User

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

  1. Tar zxvf jdk-7u51-linux-x64.tar.gz
  2. Tar zxvf apache-tomcat-7.0.52.tar.gz

3. Install

  1. Mkdir/usr/local/java/
  2. Mv jdk1.7.0 _ 51 // usr/local/java/
  3. 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

  1. # Java settings
  2. JAVA_HOME =/usr/local/java/jdk1.7.0 _ 51 (PS: based on your current path and Version)
  3. Export JAVA_HOME
  4. PATH = $ JAVA_HOME/bin: $ PATH
  5. Export PATH
  6. CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
  7. Export CLASSPATH
  8. # Tomcat settings
  9. CATALINA_HOME =/usr/local/apache-tomcat-7.0.52 (PS: changed based on your current path and Version)
  10. Export CATALINA_HOME

OK. After the modification, run the following command to make the system environment take effect.

  1. Source/etc/profile


5. start tomcat

  1. /Usr/local/apache-tomcat-7.0.52/bin/startup. sh

The following startup prompt is displayed:

  1. Using CATALINA_BASE:/usr/local/apache-tomcat-7.0.52
  2. Using CATALINA_HOME:/usr/local/apache-tomcat-7.0.52
  3. Using CATALINA_TMPDIR:/usr/local/apache-tomcat-7.0.52/temp
  4. Using JRE_HOME:/usr/java/jdk1.7.0 _ 51
  5. Using CLASSPATH:/usr/local/apache-tomcat-7.0.52/bin/bootstrap. jar:/usr/local/apache-tomcat-7.0.52/bin/tomcat-juli.jar
  6. 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,

  1. # View firewall ports
  2. Service iptables status
  3.  
  4. # Check whether Tomtcat is in the process
  5. Ps-ef | grep tomcat

At last, the Tomcat homepage is attached.


Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.