JDK environment configuration and Java execution procedures

Source: Internet
Author: User

Tag: is the item files installation path tag now configure Javac path

  1. Download the JDK and follow the prompts to install it, and finally note the installation location where the JDK is located, assuming C:\Program Files (x86) \java\jdk1.8.0_20

  2. Now start configuring environment variables. Right click on "Computer", select Properties, click "Advanced System Settings", click on "Advanced", finally click "Environment variable", enter the interface to start configuration.
  3. Select "System Variables".
  4. Click "New" in "System variables".

    The variable name is:java_home

    The variable value is:C:\Program Files (x86) \java\jdk1.8.0_20

    PS: Variable value is the path to your JDK installation I'm here for C:\Program Files (x86) \java\jdk1.8.0_20

  5. System variable "click" New ".

    The variable name is:CLASSPATH

    The value of the variable is:.;          %java_home%\lib\dt.jar;%java_home%\lib\tools.jar; (Remember that there's a "." In the front. and a ";").

  6. Find "path" in the "System variables" (we just need to add one).

    Be careful to backup your path before configuring this variable to prevent accidental deletion of!!!!!

    What you need to add is: The JDK installation path plus "\ Bin",

    Like me here is:"; C:\Program files (x86) \java\jdk1.8.0_20\bin" I'm adding it to the last side of the original, if you want to add it to the front: "C:\Program files ( x86) \java\jdk1.8.0_20\bin; "

    Look closely, in fact, the position of the semicolon has changed.

  7. After configuration, come to the cmd interface and enter "Java" and "Javac" to see if the configuration is successful!

    In fact, as long as the "Java_home" and "CLASSPATH" configuration is correct, the JAVA command will succeed, if the "path" configuration has a problem, the Javac command will fail. You can also enter path to view the paths of the JDK installation to prevent it from being found.

    1. Absolute Path : The path to a unique file or folder, starting with a drive letter. Current path : The current path, which is an absolute path. relative path : Not from the drive letter, the target path location, is part of an absolute path, and when using relative paths, it is combined with the current path as an absolute path.

javac-d Destination Path Java file path

( you can save the. Class file to the destination path file )

Set classpath=.; Target path;%classpath%

( can be compiled at the current drive letter )

2.Java Compilation execution Process: 1. Loading bytecode files

2. Verifying byte code

3. Allocating and Managing memory

4. Translate into machine code instructions and execute

5. Garbage collection

JDK environment configuration and Java execution procedures

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.