“This is the 8th day of my participation in the Gwen Challenge in November. Check out the details: The Last Gwen Challenge in 2021”
JAVA Environment Configuration
Speaking of Java environments, first we need to know what environment variables are
An environment variable is an object with a specific name in the operating system that contains information that will be used by one or more applications. For example, the path environment variable in Windows and DOS operating systems, when the system is asked to run a program without telling it the full path of the program, the system should not only look for the program in the current directory, but also look for the path specified in the path. Users can set environment variables to better run the process.
Configure the environment variables in the process of we need to use the JDK, JDK download address for www.oracle.com/technetwork…
Open the environment variables screen and click New below
JAVA_HOME variable Create a JAVA_HOME variable
Click Browse Directory, variable value is JDK installation directory, and then click OK.
The Path variable
Find the path variable in the system variable, select it, and click Edit
To make sure the JRE doesn’t cause problems when you use javaIDE, create a new variable
Note again: all characters must be in The English state.
Click OK, and then OK. Open the path variable to verify that the variable has been saved successfully.
The ClassPath variable
The input. %JAVA_HOME%\lib\dt.jar; %JAVA_HOME%\lib\tools.jar;
Click OK, close and re-open to verify that the installation was successful.
Validation of the Java runtime environment
Press the Windows + R key on the keyboard to open the run prompt box, enter CMD (short for “command”)
Type Java to verify that the Java installation is successful.
Input javac
Verified!
Eclipse develops JavaWeb projects to configure Tomcat
First we need to know what is Tomcat
Tomcat is an open source project of Apache. Tomcat server is a free and open source Web application server, which is a lightweight application server. It is widely used in small and medium-sized systems and not many concurrent users, and is the first choice for developing and debugging JSP programs. For starters, you can assume that when the Apache server is configured on a machine, you can use it to respond to requests for HTML (an application in standard Common Markup Language) pages. Tomcat is actually an extension of the Apache server, but at runtime it runs on its own, so when you run Tomcat, it actually runs as a separate process from Apache.
The tomcat download address is tomcat.apache.org
The eclipse download address to www.eclipse.org/downloads/
Open it when the download is complete
Then open the bin directory
Find startup.bat to start
Start-up success
Enter http://localhost:8080 in the address box of the browser to go to the following page. The installation is successful
Next configure Tomcat in Eclipse
Open Eclipse, click the Window menu, select the Preferences below, and find the Server option
Click On Runtime Environments and click Add
Create a New Web project
To display the Tomcat server on the console, go Window → Show View → Servers
Click No Servers are available in the area below Eclipse. Click THS link to create a new server
Select the Tomcat version in the dialog box that pops up
If the following figure is displayed, the startup is successful