Understanding rt.jar
Let's say you build a Java application that uses some core library classes such as collections and threads. When you compile and distribute your application to be run on another machine with Java installed, you can get away with packaging just the classes you've written in your application, and not include the compiled Collection and Thread classes. That's because every runtime comes with all the compiled platform classes out-of-the-box, so that every developer doesn't have to distribute them with their applications. The way these classes are bundled into the JRE is through a single file--rt.jar. You'd place your application classes in the classpath for the runtime to find, but for any of the platform classes, it just ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access