Installation and configuration of JDK

Source: Internet
Author: User

Installation and configuration of 1.JDK
The JDK installation process is similar to a general software installation, and the following are the main details of the settings required for environment variables after installation:

a) New java_home variable

After you create the variable, set the value to the JDK's installation path, for example: C:\jdk1.6

Note: This variable is mainly because many third-party software automatically looks for the Java_home variable in the system, and if not, it cannot be used, for example: Tomcat.

Also, when you create a new variable, you can use%java_home% directly without adding a long installation path when referencing the JDK path elsewhere.

b) Set the PATH variable

Add the Bin directory under the JDK installation path to the path variable, for example:%java_home%\bin

Note: This configuration is intended to make it possible for the system to directly invoke Java applications such as Javac.exe, Java.exe, etc. in this directory from anywhere

c) Setting the CLASSPATH variable
Add Sun's two feature-rich jar packages so that you can use the classes in your own Java programs, which are in the Lib directory for each of the two jar packages:
   Tools.jar and Dt.jar. For example:.; %java_home%\lib\tools.jar;%java_home%\lib\dt.jar;

Note: When setting this variable, it is especially preferable to first add the current path, which is the first one that the Java compiler will refer to in the current path search program.

A) If you are simply executing the javac command in cmd mode, you can only find the/bin in the JDK installation directory in path

b) To use a container such as Tomcat, create a new java_home environment variable to point to the JDK installation directory

Detailed reference:

2.Tomcat and Apache
Tomcat: jsp/servlet container for executing jsp/servlet; not an application server because the Java EE API is not supported
Apache: Application Server , responsible for receiving HTTP requests only supports static Web pages, but dynamic Web pages are not supported (C implementation)

Client HTTP request---->apache received, forwarded Jsp/servlet request to Tomcat----->
Tomcat to process and process the backhaul Apache
The client receives a response <----Apache accepts the Tomcat return information and forwards it to the client <------

Note: 1) Tomcat is embedded in Apache as its jsp/servlet container
2) Tomcat makes up for the bug that Apache does not support dynamic Web pages, and Apache can respond to more

Installation and configuration of JDK

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.