Java Configuration----JDK development environment Construction and environment variable configuration

Source: Internet
Author: User

Article Source: http://www.cnblogs.com/smyhvae/p/3788534.html

Body

1. Install the JDK development environment

Download site: http://www.oracle.com/

To start installing the JDK:

Modify the installation directory as follows:

When you are sure, click Next.

Note: When prompted to install the JRE, you can choose not to install.

2. Configure Environment variables:

For Java program Development, the main use of the JDK's two commands: Javac.exe, Java.exe. Path: C:\Java\jdk 1.7.0 _09\bin. However, because these commands are not part of the Windows own commands, you need to configure the path to use them.  

Click Computer-Properties-Advanced system settings, click Environment Variables. Click New under the System Variables column to create a new system environment variable.

(1) New variable name "Java_home", Variable Value "C:\Java\jdk1.8.0_05" (that is, the JDK installation path)
(2) Edit, variable name "Path", at the end of the value of the original variable, add ";%java_home%\bin;%java_home%\jre\bin"
(3) New variable name "CLASSPATH", Variable Value ".; %java_home%\lib;%java_home%\lib\dt.jar;%java_home%\lib\tools.jar "

For example:java_home environment variable operation is as follows:

3, confirm whether the environment configuration is true:

In the console, enter the java,javac,java-version command separately, with the compiler information for the JDK as shown below, including information such as modifying the syntax and parameter options for the command.

Java command:

Javac command:

Java-version command:

4. Verify the first Java program under the console:

public class Test {public    static void Main (string[] args) {        Systerm.out.println ("Hello Java");}    }

Write in Notepad, click "Save", and deposit the C packing directory, enter Javac Test.java and Java Test command, you can run the program (print out the result "Hello Java"). Note: These two commands are under the D:\java\jdk1.8.0_20\bin directory.

Program parsing:

First write the Java source Code program, extension. java;

In command-line mode, enter the command: Javac the source file name. Java, compile the source code, generate a class bytecode file;

After compiling, if there is no error message, enter the command: Java HelloWorld, the class bytecode file interpretation run, do not need to add the. class extension. See:

Note: If you enter the Javac test.java command in CMD, the display of ' Javac ' is not an internal or external command because the JDK development environment or environment variable configuration is not installed in the wrong place.

Related Source:

SOURCE Location: D:\java\jdk1.8.0_20\src.zip

Java Configuration----JDK development environment Construction and environment variable configuration

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.