Java Basic Development Environment construction

Source: Internet
Author: User
Tags win32 apache tomcat java se

One, the development tool gets 1, the development Kit JDK:

Download to the ORACLE Company official site (http://www.oracle.com/) .

Download the file selection:

For the Windows operating system, the file name format for the last downloaded file is:jdk-6ux-windows-i586.exe, where "6uX" represents the version, including the JDK and JRE, file size is about 70M; for example, I download the latest JDK for Java SE Development Kit 6 Update, the corresponding filename is called Jdk-6u25-windows-i586.exe, the file size is 76.66M. What you see in the related pages:

2. Java Webof the applicationWebserver--Tomcat

:

:Tomcat official website (http://tomcat.apache.org)

Download file selection: Left side of official websiteDownloadGives aTomcatThe various version numbers, select a version number to the download page;Quick NavigationArea, click the latest version number hyperlink to navigate to the bottom of the operating system and platform for eachTomcatDownload the list, amongZIPThe corresponding isWindowsThe version number under the system.tar.gzForLinuxDevelopment package under the platform. Related pages refer to the following chart for example:

3.JavaDevelopmentIDE——Eclipse

:

Eclipse Official site (http://www.eclipse.org), select Download to enter the download list page;

Download the file selection: Download selection: FindEclipse IDE for Java EE Developers (206M), go to the download page, download; the last file that I downloaded isEclipse-jee-helios-sr2-win32.zip, related pages such as the following:

EclipseChinese Pack Download:

Http://www.eclipse.org/babel, on the left side of the Babel Project homepage, click "Download" to enter the download list page, which is based on the download of Eclipse to select the appropriate version number of the language pack, such as the Helios version number, Click to go to the Multi-Language Pack download page and find the Language:chinese (Simplified) sub-title, which includes the Chinese simplified package for different eclipse plugins babellanguagepack-eclipse-zh_ The 3.6.0.v***.zip file is the core language pack for Eclipse, click to go to the detailed download page to download. After the download is complete, overwrite the appropriate directory for Eclipse to successfully join the Chinese language pack. The relevant guidelines are as follows:

II. installation and environment configuration of development tools 1,JDKInstallation and Configuration

Installation

Directly perform the downloaded installation JDK file Jdk-6u25-windows-i586.exe and follow the instructions to install it. In the middle of the selection of the JRE installation, also installed.

Additional notes: JDK vs. JRE

JDK is the Java development platform, when writing Java programs, the JDK needs to compile processing; the JRE is the execution environment of the Java program, including the implementation of the JVM and the Java Core Class library, the compiled Java program must be executed using the JRE. The JDK and JRE are integrated in the downloaded JDK installation package, so you will be prompted to install the JRE during the installation of the JDK.

Environment configuration:

In the environment variable of "My Computer", join? JAVA system variables; The detailed operation is to create a new variable named "Java_home" in the "System variables" area, the value of which is the JDK's installation path, such as "c:/java/jdk1.6.0_25", and then add Java_home to the system variable path, By editing open the system variable path, add the code "%java_home%/bin;" In the double-argument, it is necessary to separate the semicolon from the original value.

Test:

After installing the JDK, execute the JDK command in the cmd command line form: Javac. The effect of its success

2. Tomcat Installation and folder description

Installation

After downloading Tomcat, the direct decompression can be used;

Tomcat important folder and file role:

? Bin:

A script file for booting and shutting Tomcat under various platforms. In this folder there are two very important files--startup.bat, Shutdown.bat, the former is Windows launched Tomcat files, the latter is the corresponding close file;

? conf:

Tomcat's various profiles, in which Server.xml is the server's main configuration file, Web. XML is a configuration file for all of the website applications, Tomcat-users.xml is used to define Tomcat user information, configure user permissions and security.

? Lib:

This folder holds the jar that Tomcatserver and all Web apps can access.

? logs:

Log files for Tomcat, and all of Tomcat's logs are stored in this folder.

? Temp:

Temporary folder, tomcat execution assumes that a temporary file will be saved in this folder.

? WebApps folder:

The Web App's advertisement folder, where the Java Web site or war file is placed in this folder, can be visited by Tomcatserver.

? work:

The servlet file generated by the Tomcat parsing JSP is placed in this folder.

Test:

Under the Bin folder , double-click the Starup.bat file to execute Tomcat, and in the browser input: http://localhost:8080, visit Tomcat. Show Demo Sample For example to see the page that proves that Tomcat executed successfully.

3.

Eclipse Installation and Configuration

Installation

After the eclipse is downloaded, the resulting eclipse-jee-helios-sr2-win32.zip file is extracted directly and the installation of Eclipse is complete;

Chinese:

Extract the previously downloaded Chinese package babellanguagepack-eclipse-zh_3.6.0.v***.zip directly and get a folder called Eclipse, which contains two folders: Features and plugins, Select them and copy them to the Install Eclipse folder features and plugins are finished.

Integrating Eclipse and Tomcat:

The process of manually deploying and executing Web projects during development is tedious and inefficient. So you need to configure Tomcatserver to eclipse to specify a Web application server for your Web project. This enables Tomcat to operate in eclipse and proactively deploy and execute Web projects. The configuration process is as follows:

In Eclipse, form--Preferences--server (server)--Execution time environment (runtime environments)--join? (add), join? Tomcatserver. Select Apache Tomcat v6.0 for the corresponding installed Tomcat version number. Next, select the previous Tomcat installation folder via the "browse (Brower)" button, and then click "Finish" to complete the configuration. The guidelines are as follows:


Specify a Web browser for eclipse

Open Eclipse, form--preferences--General--web Browser--check Use external Web browser-tick internet explorer--OK.

Specify the encoding format for JSP pages in eclipse

By default, creating a JSP page in Eclipse is the "iso-8859-1" encoding format. This format does not support the Chinese character set, it will be garbled in writing, so you need to specify a character set that supports Chinese. Specify the method such as the following:

Open Eclipse, form--Preferences--web--jsp file--Encoding (Encoding)--dropdown Select ISO 10646/unicode (UTF-8)

Test Java Web project Hello World

1), file--new--Dynamic Web project--Enter the project name (such as 1.1)--completed, the project was created successfully;

2), Project Explorer--selected items (such as 1.1)--webcontent node--right--new--jsp file--input file name (such as index.jsp)--Finished, the successful new JSP file;

3), open the Code form of the Index.jsp page, write the output "Hello world!" Code, such as the following:


<%@ page language= "java" contenttype= "text/html; charset=utf-8" pageencoding= "UTF-8"%><! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" ><ptml> <pead><meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "><title>hello World</title></pead><body><center>hello World!</ Center></body></ptml>


4), after writing, save, in the toolbar click on the black triangle, in the Popup shortcut menu, select "Execution mode?" on server, in the dialog box that opens, tick the "Set server as Project default" check box, click "Finish" button, You can execute the project through Tomcat, and the pop-up browser displays "Hello World!" The word, well is done. The steps involved are as follows:

Third, summary

The Sound of ... It's finally over! Although very basic, but AX, action go Go go ...

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.