官术网_书友最值得收藏!

Legacy classes

A good example of classes that you don't need is the set of classes in the JRE related to CORBA. Ever heard of CORBA? If you haven't, don't despair. It's for a reason! It's an old technology that was introduced to the Java runtime back in version 1.4. It has mostly fallen out of popular use since then. Considering most applications don't use the CORBA technology anymore, wouldn't it be great if apps could be bundled with JREs that do not contain the unnecessary CORBA classes?

That's unfortunately not possible, again, because of rt.jar. Since everything gets bundled into a single runtime JAR, you cannot pick and choose what features you need. Everybody gets everything. And since the runtime has been increasing in size, so has the standalone deployable application. This is a more significant challenge when the runtime needs to be used on smaller devices with limited resources. If you are bundling the runtime with a simple Hello World application that uses just a handful of classes from the runtime, you have no option but to bundle a whole lot of unused classes in rt.jar with it. And, yes, even those old CORBA classes join in for the ride!

Java 8 introduced the concept of profiles, and with that, you can technically deploy smaller runtimes. But they do have some drawbacks. Also, this feature was just an initial step in the introduction of modularity features in Java 9 anyway. We'll examine compact profiles in detail in Chapter 4, Introducing the Modular JDK.

主站蜘蛛池模板: 视频| 克拉玛依市| 凭祥市| 保德县| 绥芬河市| 来宾市| 无棣县| 新晃| 区。| 乌鲁木齐市| 克拉玛依市| 乌拉特后旗| 紫金县| 天长市| 定兴县| 莒南县| 洛宁县| 西平县| 长沙市| 齐河县| 柯坪县| 鄂州市| 新宾| 昌黎县| 榆树市| 临沂市| 吴桥县| 全椒县| 息烽县| 翁牛特旗| 陆良县| 环江| 新余市| 昭苏县| 沂源县| 盈江县| 太保市| 郎溪县| 青州市| 丹凤县| 南木林县|