1. 下载JDK 安装包。
http://www.oracle.com/technetwork/java/javase/downloads/jdk7u9-downloads-1859576.html
文件名: jdk-7u9-windows-x64
或者登陆 http://java.sun.com 找到software download 下的 java SE 大类,根据需要下载。
2. 双击安装 JDK.
JDK 安装路径默认。并且记下来。 C:\Program Files\java\jdk1.7.0_09
点下一步 装 JRE , 路径默认。
( C:\Program Files\java\jre7)
3. 设置环境变量 (共有3个环境变量:JAVA_HOME, classpath, path )
右键“计算机” —> 属性 —> “高级系统设置” —> “高级”选项卡 —> “环境变量”--> 系统环境变量
·······························································································
点“新建”, 变量名:JAVA_HOME
变量值: C:\Program Files\java\jdk1.7.0_09
和JDK的安装路径是一样的,刚才记下来,是用在这里的。输入后,确定。
·····························································································
再点“新建”, 变量名:
classpath
变量值:
.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME\lib\tools.jar;
注意!!!前面的点分号., 千万不能忘记了!!
····························································································
第三个变量不用新建,已经有了,变量名: path 按“编辑”
可发现里面本来有内容,不要删除这些内容!!而是直接在已有内容的--> 前面,黏贴上如下代码:
.;%JAVA_HOME%\bin;
同样不要忘记前面的点分号., 还有最后的分号;
·························································································
4. 检验
开始-> 最下的搜索框里 输入 cmd 回车
输入 java , 回车
如出现类似如何使用java之类的大段文字,则成功设置了。
http://www.oracle.com/technetwork/java/javase/downloads/jdk7u9-downloads-1859576.html
文件名: jdk-7u9-windows-x64
或者登陆 http://java.sun.com 找到software download 下的 java SE 大类,根据需要下载。
2. 双击安装 JDK.
JDK 安装路径默认。并且记下来。 C:\Program Files\java\jdk1.7.0_09
点下一步 装 JRE , 路径默认。
( C:\Program Files\java\jre7)
3. 设置环境变量 (共有3个环境变量:JAVA_HOME, classpath, path )
右键“计算机” —> 属性 —> “高级系统设置” —> “高级”选项卡 —> “环境变量”--> 系统环境变量
·······························································································
点“新建”, 变量名:JAVA_HOME
变量值: C:\Program Files\java\jdk1.7.0_09
和JDK的安装路径是一样的,刚才记下来,是用在这里的。输入后,确定。
·····························································································
再点“新建”, 变量名:
classpath
变量值:
.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME\lib\tools.jar;
注意!!!前面的点分号., 千万不能忘记了!!
····························································································
第三个变量不用新建,已经有了,变量名: path 按“编辑”
可发现里面本来有内容,不要删除这些内容!!而是直接在已有内容的--> 前面,黏贴上如下代码:
.;%JAVA_HOME%\bin;
同样不要忘记前面的点分号., 还有最后的分号;
·························································································
4. 检验
开始-> 最下的搜索框里 输入 cmd 回车
输入 java , 回车
如出现类似如何使用java之类的大段文字,则成功设置了。