JRE与JDK,Path与CLASSPATH,jrejdkclasspath
分享于 点击 2214 次 点评:56
JRE与JDK,Path与CLASSPATH,jrejdkclasspath
[size=medium][color=blue][b]The distinct between jdk and jre[/b][/color]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.)
[color=blue][b]the job of the PATH and classpath environment variable[/b][/color]
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.[/size]
from:http://www.ics.uci.edu/~thornton/ics23/LabManual/SettingUpJava.html
相关文章
- 暂无相关文章
用户点评