|By Vitaly Mikheev||
|December 11, 2009 06:00 PM EST||
Java Development on Ulitzer
Steve Jobs once said that Java is a big heavyweight ball and chain. Good news: the ball is now optional! In this article, I share results we achieved after implementing a component deployment model, also known as JRE modularity, for the core of J2SE 5.0 and Java SE 6. The technology’s been in production use for more than two years and proved effective.
This is not a mere “Java gets smaller” message. Given that Project Jigsaw is emerging in JDK 7, I also offer some insights on the challenges that any implementation of modularity for the Java SE core may face, all derived from our practical experience.
“Divide and Conquer” Has Worked Out
We did not pioneer the idea that the monolithic Java SE platform needs to be split into components, it was in the air. We merely found a way of how to do that without breaking Java compatibility and implemented it in a compliant Java SE VM, Excelsior JET, back in 2007.
The goal was to let Java programmers bundle a light version of the Java Runtime with their applications leaving the unused components out so as to reduce the size of the installation package. Easier said than done, but we’ve got it made in a Java spec-compliant manner and called the technology Java Runtime Slim-Down (after Project Jigsaw appeared, it’s finally got to me that we should have to call it “Project Rock breaker” or the like).
It has been proved effective for many Java applications. For GUI applications, in particular, the size of a complete installation package with bundled Java Runtime starts from 5MB. In support of this assertion, I refer you to SWTPaint, a sample program taken from the latest Eclipse SDK.
The use of Java Runtime Slim-Down yields results you won’t get with any other Java deployment tool:
- The size of the SWTPaint installer is 5.5MB (here is a direct download link).
- The installed application need not the JRE to run and does not download any components from the Internet (so it won’t disturb your firewall).
Note that the GUI application in question is written in Java and uses Java SE 6. Oh, sorry! I had to mention that download size for Swing applications start from 8MB. Stirring the flame of Swing vs. SWT was by no means my intention. We prepared installation packages for a few sample applications, both Swing- and SWT-based, and you may download them from this page. If you are still in doubt, try the deployment technique yourself. This flash demo will help you get started.
There are good reasons for end users to love “all-inclusive” installation packages at reduced footprint rates, and it’s where a lightweight Java Runtime is of much help. At a larger scale, however, the lack of the JRE modularity impeded the evolution and adoption of the Java SE platform.
In Between a Rock and a Hard Place
A bit of history. Remember JSR-83, a proposal on the “multiarray” package originated by IBM. Its implementation could have had a great impact on the number crunching performance in Java. Nevertheless, it was approved only as a Java Standard Extension, never appeared among the core packages and eventually was withdrawn. In the final ballot, Sun made a noticeable comment: “...The proposal requires at least 82 new classes, and this seems inappropriate for the J2SE core...”. Though I personally was disappointed with the outcome, the need to damp the Java core inflation down sounded reasonable
Other JSRs were more lucky and the Java Community Process kept Java SE moving forward over the years. In 2006, I attended the Java Licensee Day event. During the Q&A part of the session devoted to then new Java SE 6, one of the licensees sharply asked: “With each release the JRE gets bigger and bigger. Our customers do not need all those new APIs. When will it stop bloating?” I then found myself thinking I agreed with him but I would rather say “Not all our customers need all those new APIs...”.
The question is how many “useful” APIs have not been approved just not to make the JRE bigger? One may ask also how many “useless” APIs have been approved and did make the JRE bigger? It’s clear that requirements of different projects vary and there is no single answer to these questions, but splitting the JRE into components could resolve these issues gracefully.
Here’s a practical example from our support records. We have customers who previously got stuck with J2SE 1.4.2 simply because the footprint of later Java versions was unacceptable for their deployment requirements. Now, after switching to the component model, they are happy users of Java SE 6.
However, I would not like to discuss the Sun’s policy on modularizing Java SE here. There were many pros and cons to consider, both technical an legal, and I fully realized some of them only when working on the Java Runtime Slim-Down technology. No shooting (in the foot)
As often happens, once we had started the design, the scope of work suddenly increased. For the truth to be told, we would not reach the goal by simply splitting the Java SE API into components and enabling the user to drop some of them. The big question was how to make the technology usable and reliable? After all, we did not want to create a thing that does not work just because the programmer removed some components too aggressively. We decided to explore the limits of this approach by interviewing those enthusiasts who pursued us for this matter. The results confirmed our suspicion – programmers are not always aware of what parts of the Java SE API are actually used in their applications. A good illustration would be the following transcript written then:
Client: I do not use that “Baggage-To-Trim” API and no longer want to carry it with my app. As you are a JVM vendor, make me happy, please.
Support Engineer: We understand you concern. Are you sure you don’t use the “Baggage-To-Trim” API?
Support Engineer:. We kindly ask you to double check it. Please run your app with java –verbose:class and inspect the log.
Client: Oops.. You surprised me! It’s proved to be used. Frankly speaking, I did not write that code where it’s used. Let me think of it.
Needless to say that we also had to think of it. In addition, Java SE components may depend on each other implicitly, via the implementing classes, and most programmers not familiar with the internals could not play safe when removing the components.
We conducted some R&D and figured out that such a technology should come with tools that help the user not shoot himself in the foot and rules which, just in case, provide the fastest recovery.
Tools and Rules
The final solution included a dependency analyzer and “safety net”. The analyzer takes the application’s classes, infers what Java SE components are likely in use and advises to the user.
Under the covers, it’s not simply checking import dependencies as that would work poorly in terms of precision. For instance, such a simplistic analysis would not have revealed that the SWT-AWT bridge, which is part of the SWT package, is not used by the SWTPaint application mentioned above. As a result, the AWT component would be sucked in and the installation size would increase. That said, analyzer design and testing had engaged us for some time.
Does it guarantee that any deployed application will never miss the removed components? I would not bet money on it. After all, a programmer could detach some components by mistake or an application may load a plug-in that uses the Java SE API more extensively than the application itself. Here the following rule comes into play. All removed components are put into a detached package and the developer has to place it on a Web server at the URL s/he assigned when creating the installation. The Web server is considered a "safety net": should the deployed application attempt to use any of the removed components, the Java Runtime will pull the package down from the server and load the requested Java classes.
On the formal side of things, we run the Java Compatibility Kit (JCK) deployed in this mode with some and all Java SE components detached. Noteworthy is that all the tests pass.
However, it is unlikely that a download of a detached package will occur in practice, provided the developer listened to the word of wisdom from the analyzer. For example, these sample applications have been downloaded over a thousand of times since we published them in May 2007, but there was not a single download of a detached package so far.
The last note is about the splitting. We have managed to carve a kernel part of Java SE, about 4MB, that have to be bundled with any application. We could not get it smaller. We wanted to break down the whole thing into more components, each of a smaller size, but were unable to do that. In general, we could obtain better download size figures if the Java SE API implementation classes would not be so tightly coupled, full of cross-references, strongly connected, melted and fused together.
The Truth About Sun Java Kernel
Initially, Sun Java Kernel was supposed include a deployment technology for reducing the download size. But what appeared in Java 6 Update 10 under the name Java Kernel is still far from the solution. The Java Kernel contains the VM and some core classes like java.lang.*, java.io.* and meets the needs of HelloWorld of sorts only. Upon application launch, the Java Kernel inevitably starts downloading the remaining packages from a Sun web site and no means are provided to package the required bundles with the application. In essence, the end users "download a downloader" and all you can do with it is specify which missing bundles must be downloaded first. This short table highlights the key differences between Java Runtime Slim-Down and Java Kernel:
You may find more details in the Java Kernel FAQ. Probably, the Java Kernel is just a preliminary step toward a solution that may appear in the future.
The first mention of the JRE modularity being found in the Annals relates to the times of JDK 1.2(!) The discussions lasted for years, the first implementation in the Sun JRE was planned for Java 1.5, then moved to Java 6. The Java Kernel appeared in Java 6 Update 10 proved to be far from the solution.
In parallel with the Java Kernel, Java Module System (JSR-277) was in the works, which, in particular, could address the JRE modularity problem but the deadlock between Sun and an OSGi lobby had it buried.
Finally, in the end of 2008, Project Jigsaw was announced and “Episode IV. The New Hope” commenced.
Four Challenges for Jigsaw
I’m not with the Java SE core group at Sun but I’ve been working with the Java SE core for more than ten years. Below I share my opinion on the main challenges to the adoption of Jigsaw in the future.
The corporate battle around OSGi needs a break. None has won and the Java Community has lost because, time after time, JRE modularity solutions appear to disappear. To use or not to use OSGi now is less of an issue as compared with the next challenge.
In modular approach, each component should be sufficiently isolated and import relations should be declared statically. Besides that, import graph should be (close to) acyclic to minimize the number of indirectly used components.
The problem is that the reference implementation of the Java SE API was coded without having modularity in mind. Somewhat it was a side-effect of the Java’s lazy classloading which created an illusion that a use of any class in Java code costs nothing until it’s actually executed at run time. It’s proved to be a technical debt and now is the time to pay the interest.
In practice, it means that spaghetti-like dependencies between the implementing classes are omnipresent and breaking the ties without breaking backward compatibility with previous Java versions is double tough. The danger is to create something like Apache Harmony: everything is implemented with an elegant internal architecture, samples work, but existing Java apps have issues.
Profiles All Over Again?
Some outlines of Jigsaw mention so called Java SE Profiles, e.g. Profile for headless apps, for basic RIA, for rich desktop apps, etc. A potential threat here is the repetition of the same old story of the monolithic JRE unless user-defined profiles will be allowed. One size does not fit all even if the presets are defined carefully.
Need for Total Modularization
There is a risk to getting no benefits from the JRE modularity alone. Most real-world applications use third-party components (Java APIs), which are yet to be modularized. Typically, applications tend to use only a part of the functionality provided by an API. Without total modularization, chances are good that unnecessary parts of (modularized) JRE will be taken in due to use of a (monolithic) third-party component. And it’s no matter whether the import declarations will be written in OSGi bundle manifests or somewhere else.
In closing, I’d like to say that we implemented Java Runtime Slim-Down due to high demand from our clients. I strongly believe, however, that modularized JRE has to come with Java SE out-of-the-box, not just as a vendor solution. I wrote this article with a little hope that our past experience would be of some help for the future development of the Java platform.
P.S. One man said that Java is a big heavyweight ball and chain. Good news: the ball is now optional! You may detach it and use module Chain only.
17th Cloud Expo, taking place Nov 3-5, 2015, at the Santa Clara Convention Center in Santa Clara, CA, will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud strategy. Meanwhile, 94% of enterprises are using some form of XaaS – software, platform, and infrastructure as a service.
Jul. 5, 2015 03:00 PM EDT Reads: 1,249
Internet of Things is moving from being a hype to a reality. Experts estimate that internet connected cars will grow to 152 million, while over 100 million internet connected wireless light bulbs and lamps will be operational by 2020. These and many other intriguing statistics highlight the importance of Internet powered devices and how market penetration is going to multiply many times over in the next few years.
Jul. 5, 2015 03:00 PM EDT Reads: 2,365
SYS-CON Events announced today that Dyn, the worldwide leader in Internet Performance, will exhibit at SYS-CON's 17th International Cloud Expo®, which will take place on November 3-5, 2015, at the Santa Clara Convention Center in Santa Clara, CA. Dyn is a cloud-based Internet Performance company. Dyn helps companies monitor, control, and optimize online infrastructure for an exceptional end-user experience. Through a world-class network and unrivaled, objective intelligence into Internet conditions, Dyn ensures traffic gets delivered faster, safer, and more reliably than ever.
Jul. 5, 2015 02:30 PM EDT Reads: 1,884
The basic integration architecture, as defined by ESBs, hasn’t changed for more than a decade. Most cloud integration providers still rely on an ESB architecture and their proprietary connectors. As a result, enterprise integration projects suffer from constraints of availability and reliability of these connectors that are not re-usable across other integration vendors. However, the rapid adoption of APIs and almost ubiquitous availability of APIs amongst most SaaS and Cloud applications are rapidly redefining traditional integration approaches and their reliance on proprietary connectors. ...
Jul. 5, 2015 02:30 PM EDT Reads: 1,162
"We have a tagline - "Power in the API Economy." What that means is everything that is built in applications and connected applications is done through APIs," explained Roberto Medrano, Executive Vice President at Akana, in this SYS-CON.tv interview at 16th Cloud Expo, held June 9-11, 2015, at the Javits Center in New York City.
Jul. 5, 2015 01:30 PM EDT Reads: 1,487
WebRTC converts the entire network into a ubiquitous communications cloud thereby connecting anytime, anywhere through any point. In his session at WebRTC Summit,, Mark Castleman, EIR at Bell Labs and Head of Future X Labs, will discuss how the transformational nature of communications is achieved through the democratizing force of WebRTC. WebRTC is doing for voice what HTML did for web content.
Jul. 5, 2015 01:00 PM EDT Reads: 1,256
Today air travel is a minefield of delays, hassles and customer disappointment. Airlines struggle to revitalize the experience. GE and M2Mi will demonstrate practical examples of how IoT solutions are helping airlines bring back personalization, reduce trip time and improve reliability. In their session at @ThingsExpo, Shyam Varan Nath, Principal Architect with GE, and Dr. Sarah Cooper, M2Mi’s VP Business Development and Engineering, will explore the IoT cloud-based platform technologies driving this change including privacy controls, data transparency and integration of real time context wi...
Jul. 5, 2015 12:00 PM EDT Reads: 1,537
Buzzword alert: Microservices and IoT at a DevOps conference? What could possibly go wrong? In this Power Panel at DevOps Summit, moderated by Jason Bloomberg, the leading expert on architecting agility for the enterprise and president of Intellyx, panelists peeled away the buzz and discuss the important architectural principles behind implementing IoT solutions for the enterprise. As remote IoT devices and sensors become increasingly intelligent, they become part of our distributed cloud environment, and we must architect and code accordingly. At the very least, you'll have no problem fillin...
Jul. 5, 2015 11:45 AM EDT Reads: 2,444
The 17th International Cloud Expo has announced that its Call for Papers is open. 17th International Cloud Expo, to be held November 3-5, 2015, at the Santa Clara Convention Center in Santa Clara, CA, brings together Cloud Computing, APM, APIs, Microservices, Security, Big Data, Internet of Things, DevOps and WebRTC to one location. With cloud computing driving a higher percentage of enterprise IT budgets every year, it becomes increasingly important to plant your flag in this fast-expanding business opportunity. Submit your speaking proposal today!
Jul. 5, 2015 11:30 AM EDT Reads: 1,280
The 5th International DevOps Summit, co-located with 17th International Cloud Expo – being held November 3-5, 2015, at the Santa Clara Convention Center in Santa Clara, CA – announces that its Call for Papers is open. Born out of proven success in agile development, cloud computing, and process automation, DevOps is a macro trend you cannot afford to miss. From showcase success stories from early adopters and web-scale businesses, DevOps is expanding to organizations of all sizes, including the world's largest enterprises – and delivering real results. Among the proven benefits, DevOps is corr...
Jul. 5, 2015 10:15 AM EDT Reads: 1,296
The Internet of Things is not only adding billions of sensors and billions of terabytes to the Internet. It is also forcing a fundamental change in the way we envision Information Technology. For the first time, more data is being created by devices at the edge of the Internet rather than from centralized systems. What does this mean for today's IT professional? In this Power Panel at @ThingsExpo, moderated by Conference Chair Roger Strukhoff, panelists addressed this very serious issue of profound change in the industry.
Jul. 5, 2015 09:30 AM EDT Reads: 1,650
Internet of Things (IoT) will be a hybrid ecosystem of diverse devices and sensors collaborating with operational and enterprise systems to create the next big application. In their session at @ThingsExpo, Bramh Gupta, founder and CEO of robomq.io, and Fred Yatzeck, principal architect leading product development at robomq.io, discussed how choosing the right middleware and integration strategy from the get-go will enable IoT solution developers to adapt and grow with the industry, while at the same time reduce Time to Market (TTM) by using plug and play capabilities offered by a robust IoT ...
Jul. 5, 2015 09:00 AM EDT Reads: 2,402
SYS-CON Events announced today that Secure Infrastructure & Services will exhibit at SYS-CON's 17th International Cloud Expo®, which will take place on November 3–5, 2015, at the Santa Clara Convention Center in Santa Clara, CA. Secure Infrastructure & Services (SIAS) is a managed services provider of cloud computing solutions for the IBM Power Systems market. The company helps mid-market firms built on IBM hardware platforms to deploy new levels of reliable and cost-effective computing and high availability solutions, leveraging the cloud and the benefits of Infrastructure-as-a-Service (IaaS...
Jul. 5, 2015 09:00 AM EDT Reads: 1,514
To many people, IoT is a buzzword whose value is not understood. Many people think IoT is all about wearables and home automation. In his session at @ThingsExpo, Mike Kavis, Vice President & Principal Cloud Architect at Cloud Technology Partners, discussed some incredible game-changing use cases and how they are transforming industries like agriculture, manufacturing, health care, and smart cities. He will discuss cool technologies like smart dust, robotics, smart labels, and much more. Prepare to be blown away with a glimpse of the future.
Jul. 4, 2015 08:30 AM EDT Reads: 1,321
Explosive growth in connected devices. Enormous amounts of data for collection and analysis. Critical use of data for split-second decision making and actionable information. All three are factors in making the Internet of Things a reality. Yet, any one factor would have an IT organization pondering its infrastructure strategy. How should your organization enhance its IT framework to enable an Internet of Things implementation? In his session at @ThingsExpo, James Kirkland, Red Hat's Chief Architect for the Internet of Things and Intelligent Systems, described how to revolutionize your archit...
Jul. 4, 2015 07:00 AM EDT Reads: 1,188
It is one thing to build single industrial IoT applications, but what will it take to build the Smart Cities and truly society-changing applications of the future? The technology won’t be the problem, it will be the number of parties that need to work together and be aligned in their motivation to succeed. In his session at @ThingsExpo, Jason Mondanaro, Director, Product Management at Metanga, discussed how you can plan to cooperate, partner, and form lasting all-star teams to change the world and it starts with business models and monetization strategies.
Jul. 3, 2015 12:00 PM EDT Reads: 2,433
SYS-CON Events announced today that BMC will exhibit at SYS-CON's 16th International Cloud Expo®, which will take place on June 9-11, 2015, at the Javits Center in New York City, NY. BMC delivers software solutions that help IT transform digital enterprises for the ultimate competitive business advantage. BMC has worked with thousands of leading companies to create and deliver powerful IT management services. From mainframe to cloud to mobile, BMC pairs high-speed digital innovation with robust IT industrialization – allowing customers to provide amazing user experiences with optimized IT per...
Jun. 29, 2015 12:15 PM EDT Reads: 2,856
There will be 150 billion connected devices by 2020. New digital businesses have already disrupted value chains across every industry. APIs are at the center of the digital business. You need to understand what assets you have that can be exposed digitally, what their digital value chain is, and how to create an effective business model around that value chain to compete in this economy. No enterprise can be complacent and not engage in the digital economy. Learn how to be the disruptor and not the disruptee.
Jun. 29, 2015 11:00 AM EDT Reads: 2,294
The Internet of Things is not only adding billions of sensors and billions of terabytes to the Internet. It is also forcing a fundamental change in the way we envision Information Technology. For the first time, more data is being created by devices at the edge of the Internet rather than from centralized systems. What does this mean for today's IT professional? In this Power Panel at @ThingsExpo, moderated by Conference Chair Roger Strukhoff, panelists will addresses this very serious issue of profound change in the industry.
Jun. 29, 2015 09:45 AM EDT Reads: 2,648
Business as usual for IT is evolving into a "Make or Buy" decision on a service-by-service conversation with input from the LOBs. How does your organization move forward with cloud? In his general session at 16th Cloud Expo, Paul Maravei, Regional Sales Manager, Hybrid Cloud and Managed Services at Cisco, discusses how Cisco and its partners offer a market-leading portfolio and ecosystem of cloud infrastructure and application services that allow you to uniquely and securely combine cloud business applications and services across multiple cloud delivery models.
Jun. 28, 2015 11:00 AM EDT Reads: 2,351