Java Basics, environment variable configuration, Java compilation, etc.

Source: Internet
Author: User

1. Download Java sdk,http://www.oracle.com/index.html,

Can download 32-bit and 64-bit,

2. Install, you can install the path by default, or you can customize the installation path. My installation is in the D-Disk Java directory,

3. Configuration of environment variables; open, computer, System Properties, advanced system settings, environment variables, main configuration 3

1) New java_home:

Variable value: D:\Java\jdk1.8.0_60 (that is, JDK installation directory)

2) New classpath:

Variable value:%java_home%\lib\dt.jar;%java_home%\lib\tools.jar; (The semicolon must be in English, and the semicolon should be added at the end, otherwise the compile error)

3) Edit path:

Variable value:%java_home%\bin;%java_home%\jre\bin; (add it after the original, do not delete the front, the semicolon band)

  

4. Check whether the configuration is successful, enter

1) The following information appears in Java

  

2) Input Javac

  

3) input java-version (middle space)

  

If the above 3 information is right, the configuration is successful, you can try to write a small program to test the following,

5. I created a Lianxi.java file in the D\java\kjavalx directory, opened with Notepad, edited

  

Save, Open command Window win+r, cmd, toggle path, compile, execute, (Take my d\java\kjavalx under Lianxi.java for example)

After the compilation is successful, the Lianxi.class file appears under Kjavalx. Execute Output Hello World

5. Remarks, (Installation environment win7,32 bit), about the meaning of Classpath,java_home,path explanation here is more detailed http://blog.csdn.net/huanghm88/article/details/3965218

Learning, learning is boundless, every day progress a little.

Hope can help you less detours, thank you for reading.

Copyright NOTICE: This article is the original blogger articles, reproduced please indicate the source.

  

Java Basics, environment variable configuration, Java compilation, etc.

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.