The distinct between jdk and jre:

The JDK includes a Java compiler (javac), a Java virtual machine (java), and all of the standard Java library components — in other words, everything you need to write Java programs in a wide variety of problem domains, and more than enough firepower for the assignments we’ll be giving you. (The JRE is the Java Runtime Environment, which includes the necessary code to allow you to run Java programs, but not to write and compile them! The JRE will not be sufficient for our work in this course.)

the job of the PATH and classpath environment variable:

You can execute programs from a Command Prompt (or, as Windows 95/98 call it, an "MS-DOS prompt") by simply typing their names, such as javac or java. But there’s a catch: Windows has to know where it can find these programs. This is the job of the PATH environment variable. PATH is a list of folders, separated by semicolons, in which Windows will look for a program whenever you try to execute one.

Similarly, whenever the Java compiler or Java virtual machine need to be able to use a Java class (such as when you import a class from the Java library), the compiler or virtual machine needs to be able to know where to find it. This is the job of the CLASSPATH environment variable. CLASSPATH is a list of folders, separated by semicolons, in which the Java compiler or virtual machine will look for a Java class whenever it’s trying to find one.

So, to make the JDK work, you have to modify the PATH and CLASSPATH environment variables on your system, so that Windows will be able to find javac and java, and so that javac and java will be able to find all of the necessary Java classes.

from:http://www.ics.uci.edu/~thornton/ics23/LabManual/SettingUpJava.html

 

有关java(TM) plug-in  (作者置顶)

       前几天整理机子,不小心把c盘program files下面的一个jre给删掉了,结果浏览器不支持applet.

于是就想去一个有关java 的网站,让它自动下载一个,网速太慢,也没下载成

然后去sun.com网站看了一下,才知道。原来需要下载一个jre(java runtime environment 1.*版)。因为在jre中包括两个组件:jws(java虚拟机)和java(tm) plug-in(即支持浏览器的一个java插件)。

       The Java Runtime Environment (JRE) provides the libraries, the Java Virtual Machine, and other components to run applets and applications written in the Java programming language. In addition, two key deployment technologies are part of the JRE: Java Plug-in, which enables appletsto run in popular browsers; and Java Web Start, which deploys standalone applications over a network.

Java Plug-in technology, included as part of the Java 2 Runtime Environment, Standard Edition (JRE), establishes a connection between popular browsers and the Java platform. This connection enables applets on Web sites to be run within a browser on the desktop.

   从浏览器这个角度来看,jdk和jre不同点在于,jdk里面虽然有java应用程序的开发,运行环境以及jws,但并没有java Plug-in 插件。所以无法为浏览器中的applet提供支持。我感觉其实java Plug-in就是浏览器和java虚拟机中间的一个适配器。

http://gwdjx.bokee.com/index.html

Â