Java:eclipse JSP Tomcat Environment build (complete)

Source: Internet
Author: User
Tags net domain tomcat server java se


To learn a language, the first thing to do is to build the environment, and then can write a small demo (similar to HelloWorld), not only can build confidence, but also for the subsequent learning to build a verification platform, with less effort.

NET domain vs, known as the most cattle in the field of the IDE, because only need to install the completion, you can start to develop, rarely need you to configure, but Java is not the same, various configurations, for unfamiliar or in the net to Java friends, really headache.

This article on the configuration of the Java environment, to do a systematic introduction, I hope can help to get started friends.

Java was introduced by Sun in 1995, actually think distance now (2016) years also but 20几 years of time, is not unfathomable, unreachable, so first eliminate fear, actually not difficult.

Java is divided into three systems:

# java SE--S is standard, so it's the normal version

# java EE--E is enterprise, so it is Business Edition

# java ME--M is micro, so it's a miniature version

This article describes the installation configuration of JDK/JRE, the installation configuration of Tomcat, the simple configuration of Eclipse Environment Construction

To build the Java environment, the first thing to face is the two guys: JDK and JRE

#JDK- JAva Development KIt is a SDK for software development kits;

#JRE- JAva Runtime Environment is the operating environment of a Java program;

So it's good to understand: To develop Java, the preferred use of the JDK, of course, you can choose other, and if you want to run Java programs, you must not leave the JRE, these two guys are doing this job.

Distinguish between the role of Ta two, in fact, it is not difficult to understand, if you do not develop, just run Java, then you only need to install the JRE.

Next Download the installation: JDK Download

Choose the download according to your platform, and then install, the installation process is still relatively simple, note the installation path can be, after use.

When installing the JDK, you will be prompted to install the JRE at the same time and choose a location (I recommend that you have the same directory as the JDK).

After the installation is complete, in a simple step, it is done, that is to configure the environment variables (I hate this process, why the installation is not automatically configured, although the process is simple):

My Computer-right--properties, open the following window:

The configuration is as follows:

    • Variable name: java_home
    • Variable value: D:\Program files\java\jdk1.7.0 [This is my installation path, be sure to replace it with yours]
    • Variable name: CLASSPATH
    • Variable value:.; %java_home%\lib; Remember, there's a "." in front.
    • Variable name: Path [General computer, which has this variable name, you just need to edit it]
    • Variable value:%java_home%\bin;%java_home%\jre\bin;

Well, it's basically over here, you can try it:

Win+r: Open cmd Command window: input: Java or java-version or javac can be, display as follows, you have taken the first step of success:


Do you know the IIS under window? You know, it's a good idea, don't you? Well, Tomcat is an application server and is the first choice for developing and debugging JSP programs.

First download it: Download tomcat

I recommend that you choose 8.0, because as of now (2016-3) Eclipse is very cumbersome to configure for 9.0, but support for 8.0 is good.

Unzip after download, do not install.

It is important to note that JDK/JRE environment variables must be configured, otherwise Tomcat will not work because Tomcat is written in Java and requires an environment.

The bin directory holds some executable programs and related content that start running Tomcat. Conf stores the global configuration about the Tomcat server. The Lib directory holds the jar packages required for Tomcat to run or the site to run, and all the sites on this Tomcat share these jar packages. The Wabapps directory is the default site root directory and can be changed. The work directory is used for excessive resources when the server is running, simply to store the JSP, servlet translation, and compiled results.

Open the Bin directory, locate the "Startup.bat" file, double-click Run, and if open cmd window shows "Server Startup in * * * S" prompt, then you have succeeded


Now that you have installed the Java environment and application Server, the next step is to configure the development tools, Java has a lot of development tools, but I recommend the use of Eclipse, you understand the value of TA:

Recommended download for Eclipse EE version: Eclipse IDE for Java EE developers

This also does not need to install, unzip can, then run "Eclipse.exe":

Before you create a project, start with a simple setup:

  # Modify the default encoding: default is not UTF-8, we modify it:


So your new JSP file, the code is UTF-8:

<%@ page language= "java" contenttype= "text/html; Charset=utf-8 "pageencoding=" UTF-8 "%>


This will open the browser you specified, rather than the built-in browser, when you run the JSP.

Finally you can create a JSP project:

Create a Web project:

Click the new Runtime button, configure the Tomcat service, and then "Finish" to successfully create the Web project, the directory is explained as follows:

    • Deployment Descriptor: Description of the deployment.
    • Web App Libraries: Add your own package can be placed inside.
    • Build: Put the compiled file.
    • WebContent: Put into the Write page.

You can create a new index.jsp file, and then enter something to run a look at the effect:

If it succeeds, then congratulations!

If it fails, I can't Hold you!

Java:eclipse JSP Tomcat Environment build (complete)

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: 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.