Build a Java environment

Source: Internet
Author: User

Build a Java environment

    • Determine what JRE and JDK are;
    • Download and install JDK;
    • Configure environment variables;
    • Verify whether the building is successful;

1. JRE: Java runtime eviroment, that is, the Java Runtime Environment. Including Java Virtual Machine JVM and JavaProgramIf you want to run a developed Java program, you only need to install JRE on the target computer.

2. JDK: Java Development Kit (Java Development Kit. JDK is provided for Java developers, including Java development tools and JRE. Therefore, if JDK is installed, you do not need to install JRE separately. The main development tool is the compilation tool (javac.exe.pdf and packaging tool (jar.exe ).

3. Relationship between JRE and JDK: Use the Java program developed by JDK to run it with JRE. Appendix: Java platform technical structure .jpg

4. For details about how to download and install JDK, see blog: setting up the basic Java development environment.

Note:

    • Avoid spaces and Chinese characters in the JDK installation directory name to avoid unnecessary problems;
    • After JDK is installed, a dialog box will pop up asking you to choose to install the JRE path. In fact, JDK is already included in the previous installation, so you can select "cancel ", you do not need to install a separate JRE;
    • The JDK obtained after installation is actually a green software, which can be copied to other devices separately. The difference between installation and installation is that the installation version can automatically add a registry to the system and update the network.

5. Environment Configuration:

    • Bin: Bin is short for English binary. This directory mainly stores Java development tools, basically EXE files;
    • Configuration Principle: Tell the system the directory (such as the bin directory) where the development tools provided by Java are located, and the system will help us find the commands we need to execute, in this way, we can use the development tools provided by Java anywhere in the system, instead of running them in the target directory (such as the bin directory) every time;
    • Configuration method: add the bin directory to the path of the system environment variable. Remember to use the semicolon (;) to separate the paths. When some software is installed, the execution path is automatically added to the path.
    • The java_home setting only makes it easier for you to manage the path;
    • The environment variables set through the set path command in the doscommand line window are only valid in the current doscommand line window, but the DOS window opened through the srart window will follow the environment variables of the original window;

6. verify whether the configuration is successful:

After the configuration is complete, re-open a DOS window and be sure to re-open it to use the new environment variable, and then enter javac to display the relevant information, which indicates that the basic Java development environment is successfully installed.

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.