JAVA environment variable and TomCat server configuration, tomcat server configuration

Source: Internet
Author: User

JAVA environment variable and TomCat server configuration, tomcat server configuration

The Tomcat server is a free open-source Web application server, which is a lightweight application server. It is widely used in small and medium systems and concurrent users, is the first choice for developing and debugging JSP programs. For a beginner, it can be thought that when an Apache server is configured on a machine, it can be used to respond to access requests on the HTML (an application under the standard General Markup Language) page. In fact, Tomcat is an extension of the Apache server, but it runs independently. Therefore, when you run tomcat, it actually runs independently as a process independent of Apache.

Currently, the latest version of Tomcat is 9.0. Today, we will show you how to download the configuration of Tomcat 9 in Windows.

Step 1: Configure JDK environment variables (32-bit/64-bit) consistent with the system (1) download the JDK installation package on the official website:

Official Website:

Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Select the corresponding installation package based on your operating system (Be sure to accept the license agreement)

(2) install JDK:

When JDK is installed in the installation directory, two installation prompts are displayed. Jdk is installed for the first time, and jre is installed for the second time. We recommend that you install both of them in different folders in the same java folder. (Jdk and jre cannot all be installed in the root directory of the java folder. errors may occur when they are installed in the same folder)

As shown in figure

(3) Configure Environment Variables

After JDK is installed, configure the environment variable computer → properties → advanced system settings → advanced → environment variable

System variable → new java-home variable.

Enter the jdk installation directory (C: \ ProgramFiles \ Java \ jdk1.8.0 _ 111) as the variable value)

System variable → search for Path variable → Edit

Enter % java-home % \ bin at the end of the variable value;

(Note that there is no; number at the end of the variable value of the original Path. If not, first enter; number and then enter the above Code)

System variable → new CLASSPATH variable

Enter the variable value.; % java-home % \ lib \ tools. jar (note the first one)

System variable configuration is complete.

Step 2: Verify that JDK is configured successfully (32-bit/64-bit)

Check whether the configuration is successful. Run cmd and enter java-version (there is a space between java and-version)

If the version information is displayed, the installation and configuration are successful.

If it is 64-bit, there will be clear version comments. If it is not, it will be 32-bit

Step 3: install and configure Tomcat 9 (1) download Tomcat 9 from the official website

Download the latest tomcat version

Http://tomcat.apache.org/download-90.cgi

Download without installation, this configuration demo decompress I placed in the D: \ Program Files \ apache-tomcat-9.0.0.M15 directory.

Note that 32 is in the 64-bit JDK. Otherwise, TomCat is started and a specific error 1 is reported.

(2) Configure TOMCAT using the CMD command

(3) Four Methods for starting TOMCAT

1. Double-click startup. bat in the bin directory to run tomcat in batches (the advantage is that you can see the running status, and the code reports an error in the database. Recommended)

2. Run cmd as an administrator to run the net starttomcat9 command (9 is the version number)

3. Run the service in the task manager.

The tomcat9w.exe in the 4、double-click directory is punched in and click start to run tomcat. The following figure shows the example:

(4) successful demonstration

Related Article

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.