Learn the Java environment to build and install the JDK, configure environment variables

Source: Internet
Author: User

Learning JAVA environment is set up under the JDK and install, configure environment variables

工欲善其事, its prerequisite. To learn a good java language, you must first build the environment to develop and run the Java language, and in the course of learning, develop the Java Language development process in the language sense, after all , the JAVA language keyword, class library and tools have More than a, like we are in the word is the same complex. Gossip, no nonsense .

first to download the relevant software, generally on the internet can search a lot of, but it is best to download on the official website, attached here i download the address: http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html Span style= "font-family: ' The song Body '; > (this address is also my search for a long time, I downloaded the jdk6.0 version, You need to download the words in oracle first register an account).

install JDK All the way next, but it's best to install the directory I installed under the directory I know is d : \program Files\java\jdk1.6.0_01 jdk when you need to install jre directory is the same d:\program files\ Java\jdk1.6.0_01\jre (Here I install "not encountered, but 1.6.43 Span style= "font-family: ' The song Body '; > have). The installation is complete and the environment variables are set up next.

first right-click computer → → advanced system settings → advanced →

1 Java_home variable Span style= "font-family: ' The song Body '; > The variable value is filled in jdk installation directory (this document installation directory is d:\program files\java\jdk1.6.0_01) java system settings for the installation path.

2 Path variable and select the row → select Edit in variable value, The cursor is positioned to the variable value last entered ;%java_home%\bin ;%java_home%\jre\bin "(Note the original

3 , in system variables → New CLASSPATH variable (variable name input CLASSPATH ), variable values are filled in   .; %java_home%\lib;%java_home%\lib\tools.jar(note the origin and semicolon of the first half-width) to this system variable configuration is complete.

The next step is to test whether the installation is correct.

Open a command window input java–version and the javac-version , the installation succeeds if the version information is displayed normally.

C:\users\administrator>java-version

Java Version "1.6.0_01"

Java (TM) SE Runtime Environment (BUILD1.6.0_01-B06)

Java HotSpot (TM) 64-bit Server VM (build1.6.0_01-b06, Mixed mode)


C:\users\administrator>javac-version

Javac 1.6.0_01


If you can set it up correctly, start learning to write Hello World ! , everyone learns a program for programming languages. But a lot of people are not able to compile and run their own JAVA program written (Ps including me also)

the next step is to encounter environment variable settings that are not successful, such as java–version can display version information normally, and JAVAC not be able to display normally, promotion is not internal command what should I do?

There are many reasons for this, one is that for the first time there is no setting for the environment variable setting, and No Exit command dialog to continue testing is definitely incorrect. Here to give a try, the author's treatment methods:

1 , check your settings and use them after any problems Set command to see if the settings are correct in the command window;


C:\users\administrator>set

......

classpath=.;D: \ Programfiles\java\jdk1.6.0_01\lib;d:\program Files\java\jdk_01\lib\tools.jar

......

Java_home=d:\programfiles\java\jdk1.6.0_01

......

Os=windows_nt

Path=c:\program Files (x86) \amdapp\bin\x86_64; C:\Program Files (x86) \AMD an\x86; C:\Windows\system32; C:\Windows; C:\Windows\System32\Wbem; C:\Windows\Sy2\WindowsPowerShell\v1.0\; C:\ProgramFiles (x86) \ati Technologies\ati. ace\ctatic; D:\programfiles\java\jdk1.6.0_01\bin;d:\program Files\java\jdk1.6.0_e\bin

......


2 , mainly look at the red three lines and set the correct, where the previous set of %java_home%\ will automatically become Java_home make sure that the directory settings are correct and that the correct configuration is not set.


650) this.width=650; "title=" 2016.02.21 1.png "style=" Float:none; "src=" http://s3.51cto.com/wyfs02/M00/7B/42/ Wkiol1bjiywj0x_caacp-fwnhts141.png "alt=" Wkiol1bjiywj0x_caacp-fwnhts141.png "/>



3 , if the Environment variable Settings dialog box is correct, or cannot run, close the Command dialog box and reopen a dialog box to run. Remember to set it up. Be sure to use the command Window set to view and compare the environment variables in the dialog box.

650) this.width=650; "title=" 2016.02.21 2.png "style=" Float:none; "src=" http://s4.51cto.com/wyfs02/M01/7B/43/ Wkiom1bjirvhbusvaac4nidi8s4976.png "alt=" Wkiom1bjirvhbusvaac4nidi8s4976.png "/>

Long_q_jiao

Sunday February 21, 2016


This article is from the "Long_q_jiao" blog, make sure to keep this source http://733955.blog.51cto.com/723955/1743811

Learn the Java environment to build and install the JDK, configure environment variables

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.