Getting Started with JavaWeb - Installing Tomcat Server in a Windows Environment

Summary: This article mainly studies how to download and install Tomcat server in a Windows environment.

download

Get the installation package

Recommend downloading Tomcat on the official website:

https://tomcat.apache.org/

This download is the latest version of 9.0.29. You can also download the historical version in the following link:

https://archive.apache.org/dist/tomcat/

If you don't know which version to download, you can find the recommended version based on the version of other technologies:

Version of the installation package

Each version provides different installation packages for different environments and can be loaded as appropriate:

apache-tomcat-x.zip: The basic publishing package for Windows, which does not contain batch scripts for the Windows service and APR local libraries under Windows.

apache-tomcat-x.tar.gz: Same as zip packages, but in a different compression format, it is mainly available for Linux systems.

apache-tomcat-x.exe: An executable installation package for Windows that is essentially functional and zip-compliant and can be started using Windows shortcuts and system services.

apache-tomcat-x-windows-x86.zip:32-bit Windows distribution package containing 32-bit native APR libraries for use with the JVM of the Windows system, adapted to 32-bit and 64-bit operating systems.

apache-tomcat-x-windows-x64.zip:64-bit Windows distribution package, which contains 32-bit native APR libraries for use with the JVM of the Windows system, adapts only to 64-bit operating systems.

install

Unzip the downloaded apache-tomcat-9.0.29.zip file into the installation directory.

Check that the system has Java environment variables configured, because the execution of the Servlet service in the Tomcat server and the parsing of the JSP page depend on the Java running environment, so you need to configure environment variables to run the server.

After confirming the Java environment variable configuration, enter Tomcat's unzipped directory, enter the bin folder, and execute the startup.bat file.At this point, there will be a black window like a command prompt:

 1 27-Nov-2019 17:00:06.781 information [main] org.apache.catalina.startup.VersionLoggerListener.log Server.Server Version:     Apache Tomcat/9.0.29
 2 27-Nov-2019 17:00:06.786 information [main] org.apache.catalina.startup.VersionLoggerListener.log Server Build:            Nov 16 2019 17:29:07 UTC
 3 27-Nov-2019 17:00:06.787 information [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number(: 9.0.29.0
 4 27-Nov-2019 17:00:06.788 information [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Windows 10
 5 27-Nov-2019 17:00:06.788 information [main] org.apache.catalina.startup.VersionLoggerListener.log OS.Edition:               10.0
 6 27-Nov-2019 17:00:06.789 information [main] org.apache.catalina.startup.VersionLoggerListener.log Framework:                  amd64
 7 27-Nov-2019 17:00:06.789 information [main] org.apache.catalina.startup.VersionLoggerListener.log Java environment variable:         ...
 8 27-Nov-2019 17:00:06.789 information [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Edition:              1.8.0_91-b15
 9 27-Nov-2019 17:00:06.790 information [main] org.apache.catalina.startup.VersionLoggerListener.log JVM.Supplier:            Oracle Corporation
10 27-Nov-2019 17:00:06.794 information [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         ...
11 27-Nov-2019 17:00:06.795 information [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         ...
12 27-Nov-2019 17:00:06.796 information [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=...
13 ...
14 27-Nov-2019 17:00:08.003 information [main] org.apache.catalina.startup.Catalina.start Server startup in [891] milliseconds

Open your browser and type http://localhost:8080 or http://127.0.0.1:8080 in the address bar. If you see the following page, you can verify that the startup was successful:

The presence of a command line window indicates that the server is running, and closing the command line is equivalent to closing the server.(

Tags: Java Apache Tomcat Windows jvm

Posted on Thu, 28 Nov 2019 12:05:45 -0800 by waseembari1985