i know that the JDK consists of all java packages .But what does the JRE consist of apart from java.exe ? I could understand the necessities of things in 'bin' folder in the JRE but what about the 'lib' folder ?
The rest of it has the runtime support including standard class libraries.
Have a look at this JDK and JRE File Structure document from Sun's JDK documentation.
It specifically says the following about the lib
directory:
Code libraries, property settings, and resource files used by the Java runtime environment. For example:
- rt.jar -- the bootstrap classes (the RunTime classes that comprise the Java platform's core API).
- charsets.jar -- character conversion classes.
Aside from the ext subdirectory (described below) there are several additional resource subdirectories not described here.
JRE is composed of the JVM which is the runtime interpreter for the Java language, the Class Loader, Secure Execution Implementation classes, Java APIs(core classes, SE classes) and the Java Web (Deployment) foundation which includes Java Web Start.
The lib part of JRE is Java's Library containing classes that lay the foundation for features like JavaBeans Components(JBCL) and Generic Collections(GCL).