Java 17 Recipes
Download 3.2 Mb. Pdf ko'rish
|
Java 17 Recipes
13-1. Installing Tomcat
Problem You want to download and configure the main components for creating and configuring a simple Java web application project. Solution To run the examples in this chapter, you need to install the following components. • Tomcat web server • Eclipse development environment EE 480 Let’s install Tomcat. It is the Java web server of Apache’s Tomcat service, which is the servlet container that allows you to run JSP and in which Java code can run (Tomcat 10 is the latest version). It is easier and safer to download a compressed version and run the relevant scripts for the respective operating system. Tomcat listens to three main communication ports of your PC (8005, 8009, and 8080). Before installing Tomcat, you should check whether any of your other applications already listen to one or more of those ports. To do so, use the netstat command that displays information about your computer’s network communications. In Windows, you can open a terminal window and type the netstat /a command. It displays a list of active connections in tabular form. The second column of the table looks like the following. Local Address 0.0.0.0:135 0.0.0.0:445 0.0.0.0:3306 The port numbers are the numbers after the colon. After installation, if you see one or more of the ports Tomcat uses, you must change the ports it listens to. Here’s how to install Tomcat 10 correctly. 1. Go to https://tomcat.apache.org/download- 10.cgi . Below Quick Navigation, you see four links: KEYS, 10.0.13, Browse, and Archives. 2. Click 10.0.13 to take you toward the bottom of the same page to a heading with the same version number. Below the version heading, you see the Core subheading. Below that, you see the link for the zip download, arranged as follows: zip (pgp, sha512) apache-tomcat-10.0.13.zip. Click the zip link to download the apache- tomcat- 10.0.13.zip (12.2 MB) file. 3. Unzip the downloaded file in the root. At this point, you should have the C:\apache- tomcat- 10.0.13 folder. We prefer to maintain the default folder name, in this case, to use different server versions without confusion. A business situation includes different environments (such as development, test, and delivery), so remember to maintain consistency between the server versions to prevent bugs or different behaviors. Chapter 13 Java Web appliCations 481 4. Configure the server in the setenv.bat file in the C:\ apache- tomcat-10.0.13\bin folder with the following code. set "JRE_HOME=C:\jdk-17" set "JAVA_HOME=C:\jdk-17" exit /b 0 Note tomcat 10.0 requires Java 8 or later. Now the server is ready to start. Go to C:\apache-tomcat-10.0.13\bin and double- click the startup.bat file. Or, open a command window, go to the bin folder, and type Download 3.2 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling