知识&工具

导航

win7环境下配置Java环境

==下载Java SE Development Kit 8u45==

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

==环境变量配置==

1 JAVA_HOME:C:\Program Files\Java\jdk1.8.0_45
2 PATH:%JAVA_HOME%/bin;%JAVA_HOME%/jre/bin 3 CLASSPATH:.;%JAVA_HOME%/lib/dt.jar;%JAVA_HOME%/lib/tools.jar

==helloworld==

创建D:\work\demo\javatest\HelloWorld.java,内容如下

public class HelloWorld{
     public static void main(String[] args) {
         System.out.println("Hello World!");
     }
 }  

==验证==

打开cmd、

cd D:\work\demo\javatest

>javac HelloWorld.java

没有输出为正确编译

>java HelloWorld

Hello World!

==下载eclipse==

http://www.eclipse.org/

==注意点==

设置完环境变量,要重新打开cmd,生效

 

posted on 2015-05-14 06:50  康乐sty  阅读(252)  评论(0编辑  收藏  举报