1. Download Java sdk,http://www.oracle.com/index.html,
Can download 32-bit and 64-bit,
2. Install, you can install the path by default, or you can customize the installation path. My installation is in the D-Disk Java directory,
3. Configuration of environment variables; open, computer, System Properties, advanced system settings, environment variables, main configuration 3
1) New java_home:
Variable value: D:\Java\jdk1.8.0_60 (that is, JDK installation directory)
2) New classpath:
Variable value:%java_home%\lib\dt.jar;%java_home%\lib\tools.jar; (The semicolon must be in English, and the semicolon should be added at the end, otherwise the compile error)
3) Edit path:
Variable value:%java_home%\bin;%java_home%\jre\bin; (add it after the original, do not delete the front, the semicolon band)
4. Check whether the configuration is successful, enter
1) The following information appears in Java
2) Input Javac
3) input java-version (middle space)
If the above 3 information is right, the configuration is successful, you can try to write a small program to test the following,
5. I created a Lianxi.java file in the D\java\kjavalx directory, opened with Notepad, edited
Save, Open command Window win+r, cmd, toggle path, compile, execute, (Take my d\java\kjavalx under Lianxi.java for example)
After the compilation is successful, the Lianxi.class file appears under Kjavalx. Execute Output Hello World
5. Remarks, (Installation environment win7,32 bit), about the meaning of Classpath,java_home,path explanation here is more detailed http://blog.csdn.net/huanghm88/article/details/3965218
Learning, learning is boundless, every day progress a little.
Hope can help you less detours, thank you for reading.
Copyright NOTICE: This article is the original blogger articles, reproduced please indicate the source.
Java Basics, environment variable configuration, Java compilation, etc.