JAVA工具包的安装 与 环境变量的设置

JAVA工具包的安装 与 环境变量的设置

1。在http://java.sun.com/  下载JDK5.0。(可能需要代理,大家注意一下)
2。在[环境变量]的设置上,对于初学者,只需要三个变量就可以了:
   我的电脑->属性->高级->环境变量->系统变量中添加以下环境变量(假定你的j2sdk安装在c:\j2sdk1.5.0): 
        JAVA_HOME=c:\j2sdk1.5.0
        CLASSPATH=.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;  注意: . ;一定不能少,因为它代表当前路径)
        PATH=%JAVA_HOME%\bin

然后一个简单的java程序来测试J2SDK是否已安装成功。
public class helloworld
{
 public static void main(String args[])
 {
  System.out.println("hello world!");
 }
}
将上面的这段程序保存为文件名为test.java的文件。
然后打开命令提示符窗口,cd到test.java所在目录,然后键入下面的命令
javac test.java
java test
此时如果看到打印出来hello world!的话说明安装成功了;否侧,你需要仔细检查一下配置情况。


[下面摘自 Installation Notes JDK 5.0 Microsoft Windows (32-bit) ]
关于JDK安装时的文件:
Installed Directory Tree
The JDK has the directory structure shown below.
                  jdk1.5.0_<version>
  ____________________|___________________
 |    |    |    |    |   |     |      |   |
 |    |    |    |   bin lib    |    demo  |
 |    |    | LICENSE |   |     |         jre
 |    | COPYRIGHT              |        __|__
 |  README.txt              include    |     |
readme.html                           bin   lib

In addition, the Java Plug-in and Java Web Start will automatically be installed. Look for a Java Web Start icon on your desktop. There will also be an entry for Java Web Start in the Start -> Programs menu.

If you want to run Netscape 7.x/Mozilla 1.x with Java Plug-in, do this:

  • Exit the Netscape 7.x/Mozilla 1.x browser and all Netscape 7.x/Mozilla 1.x "objects" (Messenger, Composer ...);
  • If the Quick Launch feature is enabled, disable it;
  • Then restart Netscape 7.x/Mozilla 1.x.

posted on 2006-02-26 18:31  Welfare  阅读(3411)  评论(7编辑  收藏  举报

导航