win10 build Java environment

First, Download
    jdk and jre official website: http://www.oracle.com/technetwork/java/javase/downloads/index.html

 

 

    You choose you need to download system according jdk, 32-bit system corresponding to the system corresponding to x86,64 x64

 

    After downloading get an executable file, click Run into the installation
 
 

 


  
Second, the installation
     
    1. Install JDK
select the path you want to install to, note that this path can not contain Chinese name

 


 
    Here we can select the directory you want to install by "Change", and then click Next to.
    Here we only jdk installed, the installation wizard will check your jre is not installed, then prompts you to install jre
   
    2. install the JRE
    select a folder you like, do not pay attention to this folder is jdk installation directory, otherwise it will overwrite jdk jre directory of

 

    Here we select and install the JDK directory at the same level, then click Next to complete the installation, then you have successfully installed

    3. I attach the installation folder
 

 

Third, the environment variable configuration

    My computer → Right → Properties → Advanced System Settings → Environment Variables
 
    1. New System Variable a variable named "JAVA_HOME", the value of the variable "E: \ Development \ Java \ jdk1.8.0_92" (jdk installation directory, modified according to the personal installed)

 


 
    2. then create a new variable named "CLASSPATH", variable value ";.% JAVA_HOME% \ lib \ dt.jar;% JAVA_HOME% \ lib \ tools.jar;" system variables, and pay attention to the front of the dot points some numbers are

 


      3.打开“Path”系统变量,点击新建,添加“%JAVA_HOME%\bin”和“%JAVA_HOME%\jre\bin”两个系统变量。Path使得系统可以在任何路径下识别java命令

 


 
(win7下Path打开后可能不是这样的页面,打开后需要手动输入这两个变量名,每个变量名都用英文分号隔开即可)
 
四、认证
    
    点击保存后,按window+R或者点击运行输入cmd,打开命令行窗口
    分别输入java和java -version和javac都正常运行即代表java已经正确安装,其中 java -version代表你安装的java的版本

 


 
如果出现类似"javac不是内部或外部命令"等提示语句,请再三检查你的环境变量是否正确配置,或者JDK和JRE安装目录是否重复,如果重复,可以选择再次运行下载的jdk安装程序重新安装。

Guess you like

Origin www.cnblogs.com/xiangxiushu/p/11084387.html