Java basic series-1. Java environment construction

Source: Internet
Author: User

Bytes -------------------------------------------------------------------------------------------------------------------

JRE (Java Runtime Environment) Java Runtime Environment

Includes the core class libraries required by Java Virtual Machine (JVM Java Virtual Machine) and Java programs.
JDK (Java Development Kit) Java Development Kit
JDK is provided for Java developers, including Java development tools and JRE. If JDK is installed, you do not need to use JRE.
Among them, development tools: editing tools (javac. ext) Packaging tool (jar.exe) and so on
Bytes -------------------------------------------------------------------------------------------------------------------

1. Download 2. Install 3. Configure environment variables 4. Test

Example
Java_home: D: \ My \ It \ Java \ jdk1.6.0 _ 30
Path: % java_home % \ bin ;......
Classpath:.; D: \ My \ It \ Java \ classes;


JDK Installation notes:
Try to avoid installation to a path with spaces
The JDK directory is green and can be copied directly without installation.
Differences between installation and copy: the installation will write updates to the registry, but the copies are not updated.

The role of environment variables:

Configure the environment variable path: to execute the javac command in any directory
Configure the environment variable java_home: defines a variable part of the environment variable considering directory changes.
% Java_home %: dynamically obtains the value of the environment variable java_home.
Configure the environment variable classpath: You can execute Java commands in any directory.

Temporarily configure the PATH variable:
Set: view or set Environment Variables
Set path: view the value of the path environment variable.
Set Path = Haha: temporarily set the environment variable to Haha, which is only valid in the current window.
Set Path = Haha; % PATH %: Add a new Haha value based on the original value
Set Path =: Clear Environment Variables
Start: open a new window and use temporary environment variables

Path query order:First check the current directory, and then find it under the PATH environment variable
Classpath query sequence:First query the classpath, and then find it in the current directory

Set classpath = C :\; ①
Set classpath = c: \ ②
Differences:① Add-on number. First, find it under classpath. If it cannot be found, find it under the current directory.
② No extra points, only found under classpath. An error is returned if no value is found.

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.