JDK environment variable points to download configuration, configuration, three verification steps.
- First, you first need to JDK Download JDK version can be downloaded from the website needed to be based on the update. Mainstream development tools Idear download .
- 1, first of all look at the effect after successful configuration
WIN key point -> Run (or use win + r)
enter cmd
enter java -version Note: -version lowercase, not capitalized, java followed by a space
after the configuration is successful, there will be the version information java version "1.8.0_241 "
Note: this is the effect after the configuration is complete, the configuration is complete before not see this effect
- 2. Download and extract to C: \ Program Files \ Java \ jdk1.8.0_131
The correct directory is C: \ Program Files \ Java \ jdk1.8.0_131
note directory structure
- 3, under Win10 environment variable Path configuration
右键我的电脑->属性->高级->环境变量->系统变量
注意:是下面的系统变量,不是上面的用户变量
新建变量名 JAVA_HOME,变量值 C:\Program Files\Java\jdk1.8.0_131
修改变量 Path ,在最前面加上 %JAVA_HOME%\bin;
注意:"Path"是首字母大写,不要改成"PATH" bin后面要有分号;
注意:系统变量上面的用户变量里,不要有这两个,如果有应该去掉,以避免被干扰。
注意:Win10 下PATH的配置有所不同,按照下个步骤配置即可:Win10 下环境变量Path的配置
如图所示,新增一个,放在最上面即可
- 5、验证是否配置成功
点击确认关闭刚才的配置页面,这一步一定要做,否则刚才的配置不能生效
点WIN键->运行(或者使用win+r)
输入cmd命令
输入java -version
如果出现版本信息,表明配置成功
如果失败了,调整前面的配置,然后要重新启动cmd命令,而不是在原有的cmd里面输入 java -version