Java Web Learning (3): Win7 64-bit operating system to build a Java Web development environment

Source: Internet
Author: User
Tags java web server port tomcat server apache tomcat java jdk 8


A general overview of building a Java Web development environment


Workers must sharpen their tools first. Learning to build a Java Web development environment is one of the most basic skills to learn JSP Dynamic Web site development. mainly introduced in



The process of building a Java Web development environment under the Windows 7 64-bit operating system, including the installation and configuration of the JDK, the installation and configuration of Tomcat,



Installation and configuration of the Eclipse IDE for Java EE developers .



Recommended for use here:



1) Java JDK 8.0


2) Server Tomcat 8.0


3) IDE Eclipse IDE for Java EE developers


Two installation and configuration of JDK 8.0 for JDK 8.0, no more detailed introduction, direct installation and configuration can be.


We can find the installation and configuration of JDK 8.0 on Baidu, I recommend JDK8.0 installation and configuration



pieces: http://jingyan.baidu.com/article/77b8dc7fc098786175eab642.html) , although not tried this, but looked at is basically detailed



Fine and perfect.



Because of my free-to-install green version, the installation and configuration of JDK 8.0 can be referred to in detail in the three articles I wrote in the past, which is no longer detailed



Description of the.



1) Javase Introductory Learning 2:java Development Preparation Basics:http://blog.csdn.net/erlian1992/article/details/50538259



2) Javase Getting Started Learning 3: Building a Java Development environment (i):http://blog.csdn.net/erlian1992/article/details/50540769



3) Javase Getting Started Learning 4: Building a Java Development environment (II):http://blog.csdn.net/erlian1992/article/details/50542154


three installation and configuration of Tomcat8.0


Tomcat is a core project in the Jakarta Project of the Apache Software Foundation (Apache Software Foundation), by Apache, Sun



Developed together with other companies and individuals. With Sun's involvement and support, the latest servlet and JSP specifications are always available in Tomcat



Embodiment, Tomcat 5 supports the latest servlet 2.4 and JSP 2.0 specifications. Because of its advanced technology, stable performance, and free, Tomcat is well-received by Java



Enthusiasts love and has been recognized by some software developers, become the most popular Web application server.



The Tomcat server is a free open source Web application server that belongs to a lightweight application server, in small and medium-sized systems and concurrent access



Users are not widely used in many occasions, is the first choice to develop and debug JSP programs. For a beginner, it can be thought that when in a



The Apache server is configured on the machine and can be used to respond to requests for access to the HTML (one application under the standard Universal Markup Language) page. actually Tomcat



Part of the Apache server extension, but it is run independently, so when you run Tomcat, it actually acts as a separate process from Apache



Run separately.



The trick is that when configured correctly, Apache serves HTML pages, while Tomcat actually runs JSP pages and Servlets. In addition, Tomcat and



Like a Web server such as IIS, with the ability to handle HTML pages, it is also a servlet and JSP container, the standalone servlet container is Tomcat



The default mode. However, Tomcat is less capable of handling static HTML than the Apache server. Currently, the latest version of Tomcat is 9.0.



Here we introduce the installation and configuration of Tomcat 8.0:



(1) First to download Tomcat on the official website, I use the 8.0 version, I windows 7 64-bit operating system.









(2) Unzip the downloaded compressed package into a directory that is all in English (recommended), and mine is placed in the same location as JDK 8.0, which is



E:\Java\develop.









(3) Configuration environment variable 1: We create a new system variable, its variable name is catalina_home, the variable value is its installation directory, I



is the E:\Java\develop.






(4) Configure environment variable 2: Add the Tomcat Bin directory and the Lib directory to the PATH environment variable, as we already have the Catalina_home this



environment variable, so we write the following variable value:%catalina_home%bin;%catalina_home%lib; append this to Path



environment variable values, so configuring environment variables is the safest and simplest.






(5) Open a command line Prompt window, enter the Tomcat installation directory, enter the bin directory, enter: Service.bat Install, the prompt is expressed as



Work.






(6) Finally, after entering the extracted bin directory of Tomcat 8.0, run Tomcat8w.exe, click Start, finally OK, this is the boot, I can



Reopen it and use stop to stop the Tomcat server.












(7) For step (6) We can also open Tomcat 8.0 in the extracted bin directory to run Startup.bat, which is also to start the Tomcat server, but



Stop the Tomcat server after using Shutdown.bat.









It is important to note that the above (6) and (7) can only select one of the boot Tomcat servers. Otherwise, the Tomcat server port occupancy conflict will occur.



(8) After starting the Tomcat server, enter in the browser webpage: http://localhost:8080/can open the interface to explain the configuration success.






Additional Management Account configuration:



Enter the Conf directory under the Tomcat 8.0 installation directory, which is E:\Java\develop\apache-tomcat-8.0.36\conf.






Locate the Tomcat-users.xml profile in the Conf directory, and right-click to configure it with notepad++ open.






Because it is building a Java web development environment, here we configure a Superuser admin to be able to manage Tomcat, the edited content such as



Below, the <tomcat-users></tomcat-users> tag Copy code is as follows:




 <tomcat-users>
            <role rolename="manager-gui"/> 
            <role rolename="admin-gui"/> 
            <user username="admin" password="admin" roles="manager-gui,admin-gui"/> 
       </tomcat-users>





Or:




   <tomcat-users>
            <role rolename="manager-gui"/> 
            <user username="admin" password="admin" roles="manager-gui"/> 
       </tomcat-users>
















After you restart Tomcat, we can use the same admin username and password to go to the Tomcat Server Background Management page to make



Using the Admin account to manage the Tomcat server, here is only how to configure the account, about how to use the interface to manage Tomcat is not a narrative, a



Body reference to the Tomcat Help document, the main reason is that in the development environment almost do not use this feature, and I would recommend manual configuration.



The installation and configuration of Tomcat 8.0 is almost complete.


Four installation and configuration of Eclipse IDE for Java EE developers


Go to the official website to download the corresponding version of the decompression installation, this version is the uncompressed version.



For example, the path to our extracted eclipse is: E:\Java\eclipse-jee-mars-2-win32-x86_64 (the following simplified



Called%eclipse_home%).






If we configure the JDK 8.0 environment variable, after entering%eclipse_home%, double-click "Eclipse.exe" to start ECLIPSE, start



You will be prompted to choose a workspace.






It is recommended that you create a few more workspace, you can create different project in different workspace according to the actual needs, in order to avoid future



There is more project in workspace, which affects the startup speed of Eclipse (of course, it is closed for recent project suggestions that are not in use--right-click the item



Name Select "Close Project", and if you need to open the project, right-click the closed project name and select "Open Project".



Toggle Workspace can be selected at startup, and can be toggled in "File"--"switch Workapsce" after startup.



For the use of Eclipse development tools, I have also written a series of articles: http://blog.csdn.net/erlian1992/article/details/51732072



After starting eclipse for the first time, we need to do some basic configuration, usually we need to do the following configuration:


1) Configuring the JDK


By default, Eclipse automatically associates the JDK configured in the environment variable, and if we install multiple versions of the JDK, it can be configured manually



The law is as follows: Window "--" Preferences "--" Java "--" Installed JREs "--" Add "--" standard VM "--Select our installed JDK 8.0 installation



Recorded.





2) Configure Tomcat


"Window"--"Preferences"--"Server"--"Runtime environments"--"Add"--"Apache"--"Apache Tomcat v8.0"--Select



The directory for Tomcat 8.0, in the JRE Select 1) is configured in JDK 8.0.






The configuration is complete and can be verified in the Servers view. The default Servers view is turned on below the Java EE preset view, if no



On , you can open the Servers view with "window"--"Show View"-"Server"-select Servers. in the Servers view, right- click



Click--"New"--"Server"--select "Tomcat v8.0 Server", if you see "Apache Tomcat in Server runtime environment"



v8.0 ", the configuration is successful.









This is where the Java Web Development environment is built.












Java Web Learning (3): Win7 64-bit operating system to build a Java Web development environment


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.