一,下载并安装JDK1.8版本以上
1.Oracle官网下载地址:https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
2.安装JDK,假设安装目录在:DJDK1.8
二,JDK环境变量设置
1.我的电脑鼠标右键,进入电脑属性
2.进入环境变量,新建变量名JAVA_HOME 变量值为 DJDK1.8(与JDK安装路径一致)
3.进入Path里新建 %JAVA_HOME%in (%先前的变量名%in)
三,测试
开始-命令窗口-输入cmd-输入java -version测试是否成功