The size of rt.jar is different between JRE and JDK
What I noticed is that rt.jar's size is different betwee开发者_C百科n JRE and JDK. It is bigger in JDK. Why is it so?
IIRC, primarily the JDK version contains more debug information.
There appears to be the same number of files in both:
C:\Program Files\Java>jdk1.6.0_21\bin\jar.exe tf jdk1.6.0_21\jre\lib\rt.jar | wc -l
17036
C:\Program Files\Java>jdk1.6.0_21\bin\jar.exe tf jre6\lib\rt.jar | wc -l
17036
The JDK includes among others also the implementation of the javax.tools
API which gives programmatic access to the compiler. If you're curious for more, just extract the JAR using some ZIP tool and compare the contents.
There are more files in the JDK version, compared to the JRE version.
精彩评论