Installation and configuration of _java

  • 2020-04-01 01:23:19
  • OfStack

  Learning Java has been a long time, but always feel that the foundation is not very good, sometimes encountered some usually uncommon problems will not start, also from the side of some of their own problems. Therefore, I plan to write Java notes to consolidate the foundation and enhance my study. Today is the first article, mainly about the installation and configuration of Java, also known as Hello world.

  A, download

  Go to the Oracle website, download the Java JDK,

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201301/2013010309283018.jpg ">

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201301/2013010309283019.jpg ">

< img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201301/2013010309283020.jpg ">

  Second, the installation

  Installation is simple, just need the next step can, the path can be chosen according to their needs.

  Three, configuration,

    You cannot compile the program after you have installed the JDK because you still need to configure the Java JDK. Incoming system attributes -> Advanced - > Environment variable -> System variables. And then add the path, the classpath variable,

  Path:             D: \ \ Program Files \ Java \ jdk1.7.0 _07 \ bin. (because it is placed in the front, there is a semicolon after it. The reason for this is to be the first to find it, which is convenient for efficiency.)

  The classpath:     .; D: \ \ Program Files \ Java \ jdk1.7.0 _07 \ lib \ tools. The jar. D:\Program Files\Java\jdk1.7.0_07\lib\dt.jar

I take win7 system as an example, look at the picture:

    < img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201301/2013010309283021.jpg "> -

    < img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201301/2013010309283022.jpg ">

    < img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201301/2013010309283023.jpg ">

    < img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201301/2013010309283024.jpg ">

  Four, test,

  Once the installation is configured, you can test for success. Enter CMD, type the "javac" command, if shown as follows is a successful installation, otherwise the installation is not correct, need to reinstall.

    < img Alt = "" border = 0 SRC =" / / files.jb51.net/file_images/article/201301/2013010309283025.jpg ">

  With Java installed and configured, the next step is to use it to write programs.


Related articles: