The distinct between jdk and jre[转]

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值