Installation and environment configuration of Java development and execution Environment--JDK

Source: Internet
Author: User
Tags java format

This is in the blog Park wrote the first blog, has entered the blog park for some time, want to write down some of their own technical problems and solutions, of course, the main content is about programming aspects of the content, now is just formally began to learn programming this aspect of the content, I hope that they can keep records of good habits.

This first blog wanted to record some of the problems that I encountered in installing the JDK today, and also recorded its installation and environment configuration process, mainly during the installation process because of the cause of the installation of the problem, want to try to avoid.

First is the JDK download, on the Sun Company's official website has the latest version of the JDK development toolset free download, here we take the 64-bit Windows operating system For example, select the corresponding version download. Here are the following:

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

After downloading, double click the program to enter the installation interface.

Then click Next and we will go to the selection of two installation paths in turn.

Note: These two paths cannot be the same, otherwise the installation will not succeed because of file overwrite.
Then, in order to run Java tools in any directory, we need to set up the environment under the WIN8 environment variables: Right-click My Computer, select Properties, then select Advanced System Settings, click the Environment Variables button to enter the settings. Create two new system variables:
Variable name: Java_home      Variable Value: D:\JDK1.  8.0(related to installation path) variable name: classpath      %java_home%\lib\dt.jar;%java_home%\lib\tools.jar

Add the variable value after the variable value of the system variable path:

Variable name: Path           Variable Value:%java_home%\bin;%java_home%\jre\bin

The above has completed its environment configuration, next to check the environment configuration and program installation is correct, open a command prompt, enter the command Javac, and then enter, if a similar situation occurs, the configuration is correct.

If none of the above errors, the following can write the first Java program, in a simple directory under a new text file (you can use Notepad), write the program code, and save in Hello.java format.

 Public class hello{    publicstaticvoid  main (String args[])    {    System.out.println ("hi!" +args[0]+ "" +args[1]+ "" +args[2]);}    }
Then, compile the source file, compile the. java file into a. class file, and use the command prompt to enter the command at the level of the folder (go to the next level folder before adding a CD) to find the corresponding folder, the last folder when the command is entered:
Javac Hello.java

Enter after the successful execution will be in the same folder to generate the Hello.class file, after the class file execution, input the following command:

Java Hello How is it?

Completing the above steps completes the creation, compilation, and operation of a simple Java program (standalone application).

The main problem during this period is that the selection of two paths during the installation process will cause some files to be overwritten, and the Javac.exe file cannot be found under the Bin folder, and the compilation error cannot be completed.

Installation and environment configuration of Java development and execution Environment--JDK

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.