Installation and configuration of---JDK in Java development environment

Source: Internet
Author: User
Tags java se


DownloadJDK1.6

in the past, the JDK was Sun's product, and now sun is being acquired by Oracle, saying that Oracle may have many readers who do not know that Oracle should be a household name.

so to go to the official website download JDK, should go to Oracle official website download:

http://www.oracle.com/index.html

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/4B/68/wKiom1Qr4v-BUBfAAAN6l7bPBpQ412.jpg "title=" Picture 1.png "alt=" wkiom1qr4v-bubfaaan6l7bpbpq412.jpg "/>

After clicking on Java for Developers, the download page appears, and we see a lot of download versions, and we look at the bottom of the page

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/4B/6B/wKioL1Qr4zewLFDTAADYTAVLAZI983.jpg "title=" Picture 2.png "alt=" wkiol1qr4zewlfdtaadytavlazi983.jpg "/>

This download is the old version of the JDK, reminding us that there may be something out of date, but we still use the old version of JDK1.6. Because it is not the higher the better.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/4B/68/wKiom1Qr4xXwCrZiAACxeJaHKEg335.jpg "title=" Picture 3.png "alt=" wkiom1qr4xxwcrziaacxejahkeg335.jpg "/>

A lot of versions, choose Java SE6

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/4B/6B/wKioL1Qr41CS4r_uAAFRbLDhKoE422.jpg "title=" Picture 4.png "alt=" wkiol1qr41cs4r_uaafrbldhkoe422.jpg "/>

Here I choose Java SE Development Kit 6u31 this version.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/4B/68/wKiom1Qr4yzBGN71AAORxSgBMaY613.jpg "title=" Picture 5.png "alt=" wkiom1qr4yzbgn71aaorxsgbmay613.jpg "/>

You can choose according to your own computer. Do not forget to select accept License agreement before downloading.

You need to register for a login when downloading. This is really a bit of a hassle, but for genuine purity, or compromise it. After that, wait for the download to complete.

Installing the jdk1.6-- configuration Java development environment

After downloading the JDK, it is installed. There is no difficulty, double-click the installation on the line. Installed in the F:\java.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/4B/68/wKiom1Qr4zSihlWWAADwKqUDP7A918.jpg "title=" Picture 6.png "alt=" wkiom1qr4zsihlwwaadwkqudp7a918.jpg "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/4B/6B/wKioL1Qr42jCKc5-AADTVGffYqU813.jpg "title=" Picture 7.png "alt=" wkiol1qr42jckc5-aadtvgffyqu813.jpg "/>

the two installation directories are installed in the same Java file.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/4B/6B/wKioL1Qr42_SkcX-AAGxcKzJiO0700.jpg "title=" Picture 8.png "alt=" wkiol1qr42_skcx-aagxckzjio0700.jpg "/>

If you want to use Java for development, you must compile and interpret

Compiled Java command: Javac.exe

Explanation of the Java command: Java.exe

The two commands are in the directory where the JDK is installed.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/4B/68/wKiom1Qr40nx-iB1AABhrD06lQo585.jpg "title=" Picture 9.png "alt=" wkiom1qr40nx-ib1aabhrd06lqo585.jpg "/>

If you want to be able to use both commands directly on the command line, you need to configure the path path F:\Java\jdk1.6.0_31\bin

Copy the path of the F:\Java\jdk1.6.0_31\bin.

Then find My Computer---properties---advanced---environment variables

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/4B/6B/wKioL1Qr437Rc_-YAAHjS-wRHSU137.jpg "title=" Picture 10.png "alt=" wkiol1qr437rc_-yaahjs-wrhsu137.jpg "/>

Add a semicolon (semicolon in English) to the last face of path, and then paste the path name in

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/4B/68/wKiom1Qr41eCDKReAACNrUtsEGM700.jpg "title=" Picture 11.png "alt=" wkiom1qr41ecdkreaacnrutsegm700.jpg "/>

This means that the file directory is already registered in Windows, and if you need to execute the command directly, it will be found and executed from this directory.

That is, you can execute the javac directly in the command line mode.

Open run-input cmd, enter, enter the DOS command line to write.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/4B/6B/wKioL1Qr44zRmg4FAAKMCcXbyVU185.jpg "title=" Picture 12.png "alt=" wkiol1qr44zrmg4faakmccxbyvu185.jpg "/>

Enter Javac, if the interface appears, the configuration is successful.

It is important to note that all configurations are re-read every time the command line restarts, so the command line restarts once the configuration is changed.

The first Java program

Create a new Myjava folder on the D drive, write a Test.java file, and place it in the Myjava folder.

public class Test{public static void Main (string[] args) {System.out.println ("Hello World");}}


Run it in the command line after you've written it. The command line should be restarted.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/4B/68/wKiom1Qr42vgi64ZAAJwn9gpgg0063.jpg "title=" Picture 13.png "alt=" wkiom1qr42vgi64zaajwn9gpgg0063.jpg "/>

Note: When in the previous level directory, that is, do not go to the Myjava folder. Instead, the test is executed directly in the E-drive, and it is indicated that the path cannot be found.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/4B/6B/wKioL1Qr46DRwduXAAGVU_LuOxU999.jpg "title=" Picture 14.png "alt=" wkiol1qr46drwduxaagvu_luoxu999.jpg "/>

This time we are going to set up the classpath so that it can execute the Test.class file directly without entering the Myjava file.

set classpath

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/4B/68/wKiom1Qr43ywbEqEAABc6_wPTHQ519.jpg "title=" Picture 15.png "alt=" wkiom1qr43ywbeqeaabc6_wpthq519.jpg "/>

Once this command is set for CLASSPATH, all subsequent classes are looked up directly from the E:\myjava directory.

However, in general, it is very rare to set a classpath to the specified directory, the best way is to find the desired *,class file in the current folder.

This article is from the "Huan Blog" blog, make sure to keep this source http://zhaoyuqiang.blog.51cto.com/6328846/1560293

Installation and configuration of---JDK in Java development environment

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.