A comprehensive analysis of the Java environment Configuration principle _java

Source: Internet
Author: User

Java Environment Configuration principles detailed

1.JDK installation directory file Description:

General JDK installation directory and path \java\jdk1.7.0_79\lib, which mainly contains the following folders.

Bin: The main storage is the Java tools commonly used commands such as: Java,javac.

DB: Path to install Java DB.

Include: some platform-specific header files.

JRE: The JRE environment required to run Java programs.

LIB:JDK the actual location of the tool commands, such as the Javac command in bin, is actually the Main.class file in Tools.jar\sun\tools\javac in Lib, and the Javac command in bin only wraps this class. In fact, most of the commands in the bin are packaged with the tool classes in Tool.jar.

Src.zip: Main storage Java Core Class library source code.

Other files are mainly descriptive documents.

2.Path Path setting

Java source code files need to be compiled and interpreted to execute, which requires Javac, Java commands.

The primary purpose of setting up path is to allow the system to automatically javac and Java commands in the bin file.

To set the method:

My Computer Right-----> Properties-----> Environment Variables

Environment variables have user variables and system variables, user variables mainly refers to the current user operating environment, the system variable refers to all users of the environment variable configuration. The main difference is that the system prioritizes the command that uses the system variable path.

Command lines typically look for commands through the path path, because you need to add the path where the Java Tools command is located.

Directly click New variable name: PATH variable value: \java\jdk1.7.0_79\bin; then OK.

Determine if the configuration is ready to click the Start menu---------> Run input cmd, enter the command line tool, enter Javac can see a series of javac command options. As follows:

3.ClassPath Path Configuration

The classpath path needs to be configured before the JDK, and it is now possible to configure the JDK after 1.5. The purpose of configuring the Classpath path is to let the Java Command tool know where the. class bytecode files are.

Path "." The main reason is to tell the JRE to look up the. class file in the current file, in addition to the compilation run requires Java classes in the JDK directory in Dt.jar,tool.jar, because they also need to add their paths to the classpath.

If the CLASSPATH variable name already exists in the variable environment, add it directly to the variable value.; %javahome%\lin\dt.jar;%javahome%\lib\tool.jar where%javahome% represents the installation path of the JDK.

Test whether it is configured to be the same as above the Java Help option appears when you enter Java in the cmd command line.

4. Other System Configuration

The above configuration process is mainly on the XP system, Linux system configuration can be its own Baidu Linux Java environment configuration.

The configuration here is designed to let you understand the reasons for this configuration and to help beginners quickly build a Java Runtime environment, other detailed configuration and other troubleshooting methods can refer to the JDK Help documentation.

The above Java environment Configuration principle of comprehensive analysis is small set to share all the content, hope to give you a reference, but also hope that we support the cloud habitat community.

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.