Welcome!

Microsoft Cloud Authors: Janakiram MSV, Yeshim Deniz, David H Deans, Andreas Grabner, Stackify Blog

Related Topics: Microsoft Cloud

Microsoft Cloud: Article

Java Software on Vista

Yes, it works

People have been wondering lately: How does Java software work on Windows Vista? The short answer is: Java software works great on Vista. In fact, the entire Sun engineering team working on Java Platform Standard Edition has been tuned into Vista and making Java software work on it since it was named after a breed of cattle.

Between regular calls with Microsoft, interaction with their engineers when problems or questions arose, bugs being submitted and fixed on both sides, and regular testing and engineering during Vista's development, we have been building a rock-solid release of the Java platform for Vista.

Why are people wondering at all? Older versions of Java software do have problems on Vista. But that should come as no surprise to software developers; expecting pre-Vista releases of Java software to work automatically is like expecting that your favorite XBox game, Bloody Mess X, doesn't work on XBox360. Of course it doesn't; the original game was written for a completely different system. Why should you expect it to work out of the [X]box on this new platform? It would be great if your game just worked but it just wasn't meant to be; the platforms are different enough that significant application changes are necessary.

Presumably, given the popularity of Bloody Mess X, the developers will create a port of the game to the new console ("Even more blood!"), so you'll still be able to run your favorite game on the new system.

It's the same thing here: Windows Vista is not just XP++; there are fundamentally new things about the system that makes older software break. Is all software broken? Probably not. But the more of the system an application uses, the more likely it is to run into issues in which the system has changed. In our case, Java software is not just a simple Win32 GUI application; it's a runtime platform with deep-rooted needs in the operating system, the networking stack, the security model, the graphics system, etc. If any of these subsystems change significantly, we need to adjust our software accordingly. In the case of Vista, it has been an ongoing process of learning, testing, debugging, filing bugs with Microsoft, fixing our bugs, and repeating the whole process. Since Vista has been a moving platform during the Java Platform Standard Edition 6 (Java SE 6) development process, we have been in an ongoing cycle with every new drop of Vista.

But the extra fun of debugging a moving platform doesn't mean that we haven't actually been fixing the problems. Vista has been one of the highest priorities for our Java SE 6 work. In fact, Java SE 6 has been working quite well on Vista for months. Some of the more obvious bugs (like our disabling the Aero Glass effects) have been fixed and available in snapshot releases of Java SE 6 since last spring. As we fixed problems in Java SE 6 (our primary platform for Vista support), we have also been back-porting the more important fixes to older releases so that we can provide updates to these releases for customers who require the older releases to work on Vista as well.

As pictures are worth between 999 and 1,001 words, here are a few to help you see where we are at. Figures 1 - 2 - 3 are screenshots of Java GUI applications running on the latest versions of Vista (two of our SwingSet2 demo and one of Swing-based NetBeans IDE):

The Fun We Had
If this article were a whitepaper, it might say something like "Java software works well on Vista" and then defer to a PR representative whom you can call to have them say the same thing (with a lot more words). But it seems to me that the developers who are reading this article might actually be interested in some of the technical details that we had to deal with to make Java software work on Vista. I won't cover the full gamut of problems and fixes here, but I'll hit some of the highlights.

Aero Glass
The "Aero Glass" desktop is enabled by the Desktop Window Manager (DWM) of Vista. This system runs the desktop graphics (windows, icons, ... everything you see on the screen) on top of Direct3D (a runtime library that supports hardware-accelerated 3D graphics operations). All "windows" on the desktop are actually texture maps that are composited together onto the screen. This system enables various effects that you can see on the screen, including translucent title bars, application previews in the task bar, and the new Alt-Tab and Cmd-Tab functionality for switching between applications.

PROBLEM 1: DWM DISABLING

  • Symptom: On older releases of Java software, running a Java application would "punt the DWM," which would effectively disable the Aero Glass effect. Users would see a change in the desktop appearance: the window borders would turn opaque, the desktop would lose the various whizzy effects, and application windows would essentially have more of an XP look & feel. This was probably the most obvious Java software/Vista problem on older releases to users since it caused an obvious and sudden change in the appearance of the desktop.
  • Problem: Java 2D uses DirectX for creating and accelerating offscreen images and buffers. For various reasons (including sanity-checking that DirectX was alive and synchronizing graphics operations), we would "lock" the screen, which gives us direct access to the pixels on the screen. Locking the screen is, however, a great way to make the DWM punt on Vista because of the new composited-desktop approach - applications in DWM no longer have direct access to the screen itself. If an application demands access (such as through this older DirectDraw locking command), Vista will oblige the request, but only by first disabling DWM, and thus disabling Aero Glass.
  • Solution: We found less obvious ways of getting what we needed and no longer lock the screen. This avoids the DWM punt and makes Java software run much more seamlessly on Vista.
PROBLEM 2: GRAPHICS ARTIFACTS (BLACK RECTANGLES)
  • Symptom: Once we had fixed the DWM-punting bug above, we unmasked the problem that Java GUIs would sometimes be littered with black boxes or draw the content in the wrong place.
  • Problem: Desktop Java ends up using both DirectX and GDI to draw content into a Java application window, which worked fine on Windows pre-Vista but causes mayhem in the Vista rendering system.
  • Solution: The quickest solution was to simply disable our use of DirectX on Vista. We are basically forced to use one or the other: GDI or DirectX. We cannot avoid GDI because we need access to basic window system capabilities, so DirectX had to go. There is a more complete solution in the works for Java Platform Standard Edition 7 (Java SE 7) that will involve a much more complete implementation on top of Direct3D with a more involved and capable buffering system that will allow us to use DirectX in a much more Vista-friendly manner.
Swing Native Look & Feel
Vista has a completely new look & feel. Beyond the Aero Glass effects discussed earlier, there are new looks to the buttons, the windows, and all of the other normal desktop widgets. Vista did not simply tweak the XP look & feel resources, it implemented these new looks through a completely different mechanism. Swing's old approach of using the XP look & feel resources had to be re-thought in the context of this new world.

PROBLEM 1: NEW NATIVE LOOK & FEEL

  • Symptom: A Swing application using the native look & feel on older Java software releases actually does have a native look on Vista; it just happens to be a Windows 2000 native look.
  • Problem: In Windows XP, Swing derived its native look & feel from resources on the system that XP used. Essentially, we were using the same core resources as XP to make our components look native. Vista uses a completely new system with new resource locations and formats, so not only did we not look Vista-native on Vista, we didn't even look XP-native.
  • Solution: In Java SE 6, the Swing native look & feel for both Windows and GTK was rewritten to use the native platform-rendering engine to draw Swing widgets. Instead of our old approach of doing our own rendering, we now call the native rendering system to draw the widgets for us (through the UXTheme API). As soon as this work was done, Swing looked Vista-native on Vista (as well as XP-native on XP).
PROBLEM 2: NATIVE LOOK & FEEL ANIMATION
  • Symptom: Some Vista components animate between different states. For example, moving the mouse over a button will cause a cross fade between the default state and the mouse-over state. Meanwhile, Swing components (like native desktop components pre-Vista ) have always simply switched between these states (a toggle, not an animation). Where you might see an animation on a component in a native Vista application, you would see a simple (non-animated) state change in Swing.
  • Problem: There was no animation system on older operating systems, components simply changed state and would be drawn in the appropriate way for that new state. To handle this change in behavior, we had to implement new logic to change the appearance over time.
  • Solution: Basic support for Swing animation was put back in recent builds of Java SE 6. There are still some cases not completely handled, but things look good in general. Further fixes are planned for Java SE 6 update releases as well as Java SE 7.
Deployment
One of the more major areas of change in Vista affected our deployment technologies. Vista has made some significant changes in its security system in an attempt to make it more difficult for malicious software to gain control on the machine's resources. For example, the user is now prompted when an application needs access to a system resource such as the registry; they will get a dialog asking whether they approve this access, and asking them for the administrator password if they are not logged in as the administrator already. Internet Explorer 7 (IE7) takes this a step further and protects that entire process from accessing the raw system, so that even if an application inside the browser gains access to the system, it can only perform operations inside the very-restricted sandbox that the browser offers.

These changes had wide-reaching implications for our various deployment pieces, including the Installer, Java Update, Java Plug-in, and Java Web Start. Many of the issues were overlapping, so I'll just cover the general problem areas that we had to overcome.


More Stories By Chet Haase

Chet is an architect in the Java Client Group at Sun Microsystems. He spends most of his time working on graphics and performance issues and futures.

Comments (1) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Most Recent Comments
Eric Giguère 12/19/06 06:02:02 PM EST

The statement made in the beginning of this article is not very accurate... It is true that when you write a software, you cannot expect this one to use any features that will be written in the future. But when you write an OS, you have a certain responsability over what is called backward compatibility. So yes, there is no way that a Java JDK could possibly use the features of Windows Vista, but Windows COULD have written their new OS so that it works with older versions of Java.

But again, Microsoft does not have a very good historical background for backward compatibility.

And I also find that the example of the XBox and XBox 360 is a very bad one. For your information, Nintendo offers a COMPLETE backward compatibility with the Wii. This little guy can read the mini discs of the Game Cube, and even offers support for the old controllers of the Game Cube.

All this said, backward compatibility is a often more a marketing choice than technical limitations.

Eric.

@ThingsExpo Stories
The 22nd International Cloud Expo | 1st DXWorld Expo has announced that its Call for Papers is open. Cloud Expo | DXWorld Expo, to be held June 5-7, 2018, at the Javits Center in New York, NY, brings together Cloud Computing, Digital Transformation, Big Data, Internet of Things, DevOps, Machine Learning 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 busin...
Smart cities have the potential to change our lives at so many levels for citizens: less pollution, reduced parking obstacles, better health, education and more energy savings. Real-time data streaming and the Internet of Things (IoT) possess the power to turn this vision into a reality. However, most organizations today are building their data infrastructure to focus solely on addressing immediate business needs vs. a platform capable of quickly adapting emerging technologies to address future ...
No hype cycles or predictions of a gazillion things here. IoT is here. You get it. You know your business and have great ideas for a business transformation strategy. What comes next? Time to make it happen. In his session at @ThingsExpo, Jay Mason, an Associate Partner of Analytics, IoT & Cybersecurity at M&S Consulting, presented a step-by-step plan to develop your technology implementation strategy. He also discussed the evaluation of communication standards and IoT messaging protocols, data...
Nordstrom is transforming the way that they do business and the cloud is the key to enabling speed and hyper personalized customer experiences. In his session at 21st Cloud Expo, Ken Schow, VP of Engineering at Nordstrom, discussed some of the key learnings and common pitfalls of large enterprises moving to the cloud. This includes strategies around choosing a cloud provider(s), architecture, and lessons learned. In addition, he covered some of the best practices for structured team migration an...
With tough new regulations coming to Europe on data privacy in May 2018, Calligo will explain why in reality the effect is global and transforms how you consider critical data. EU GDPR fundamentally rewrites the rules for cloud, Big Data and IoT. In his session at 21st Cloud Expo, Adam Ryan, Vice President and General Manager EMEA at Calligo, examined the regulations and provided insight on how it affects technology, challenges the established rules and will usher in new levels of diligence arou...
In his Opening Keynote at 21st Cloud Expo, John Considine, General Manager of IBM Cloud Infrastructure, led attendees through the exciting evolution of the cloud. He looked at this major disruption from the perspective of technology, business models, and what this means for enterprises of all sizes. John Considine is General Manager of Cloud Infrastructure Services at IBM. In that role he is responsible for leading IBM’s public cloud infrastructure including strategy, development, and offering m...
In his session at 21st Cloud Expo, Raju Shreewastava, founder of Big Data Trunk, provided a fun and simple way to introduce Machine Leaning to anyone and everyone. He solved a machine learning problem and demonstrated an easy way to be able to do machine learning without even coding. Raju Shreewastava is the founder of Big Data Trunk (www.BigDataTrunk.com), a Big Data Training and consulting firm with offices in the United States. He previously led the data warehouse/business intelligence and B...
Recently, REAN Cloud built a digital concierge for a North Carolina hospital that had observed that most patient call button questions were repetitive. In addition, the paper-based process used to measure patient health metrics was laborious, not in real-time and sometimes error-prone. In their session at 21st Cloud Expo, Sean Finnerty, Executive Director, Practice Lead, Health Care & Life Science at REAN Cloud, and Dr. S.P.T. Krishnan, Principal Architect at REAN Cloud, discussed how they built...
22nd International Cloud Expo, taking place June 5-7, 2018, at the Javits Center in New York City, NY, and co-located with the 1st DXWorld Expo 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 ...
22nd International Cloud Expo, taking place June 5-7, 2018, at the Javits Center in New York City, NY, and co-located with the 1st DXWorld Expo 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 ...
DevOps at Cloud Expo – being held June 5-7, 2018, at the Javits Center in New York, NY – 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,...
@DevOpsSummit at Cloud Expo, taking place June 5-7, 2018, at the Javits Center in New York City, NY, is co-located with 22nd Cloud Expo | 1st DXWorld Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The widespread success of cloud computing is driving the DevOps revolution in enterprise IT. Now as never before, development teams must communicate and collaborate in a dynamic, 24/7/365 environment. There is no time to wait...
Cloud Expo | DXWorld Expo have announced the conference tracks for Cloud Expo 2018. Cloud Expo will be held June 5-7, 2018, at the Javits Center in New York City, and November 6-8, 2018, at the Santa Clara Convention Center, Santa Clara, CA. Digital Transformation (DX) is a major focus with the introduction of DX Expo within the program. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive ov...
SYS-CON Events announced today that T-Mobile exhibited at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. As America's Un-carrier, T-Mobile US, Inc., is redefining the way consumers and businesses buy wireless services through leading product and service innovation. The Company's advanced nationwide 4G LTE network delivers outstanding wireless experiences to 67.4 million customers who are unwilling to compromise on qua...
SYS-CON Events announced today that Cedexis will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Cedexis is the leader in data-driven enterprise global traffic management. Whether optimizing traffic through datacenters, clouds, CDNs, or any combination, Cedexis solutions drive quality and cost-effectiveness. For more information, please visit https://www.cedexis.com.
SYS-CON Events announced today that Google Cloud has been named “Keynote Sponsor” of SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Companies come to Google Cloud to transform their businesses. Google Cloud’s comprehensive portfolio – from infrastructure to apps to devices – helps enterprises innovate faster, scale smarter, stay secure, and do more with data than ever before.
SYS-CON Events announced today that Vivint to exhibit at SYS-CON's 21st Cloud Expo, which will take place on October 31 through November 2nd 2017 at the Santa Clara Convention Center in Santa Clara, California. As a leading smart home technology provider, Vivint offers home security, energy management, home automation, local cloud storage, and high-speed Internet solutions to more than one million customers throughout the United States and Canada. The end result is a smart home solution that sav...
SYS-CON Events announced today that Opsani will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Opsani is the leading provider of deployment automation systems for running and scaling traditional enterprise applications on container infrastructure.
SYS-CON Events announced today that Nirmata will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Nirmata provides a comprehensive platform, for deploying, operating, and optimizing containerized applications across clouds, powered by Kubernetes. Nirmata empowers enterprise DevOps teams by fully automating the complex operations and management of application containers and its underlying ...
SYS-CON Events announced today that Opsani to exhibit at SYS-CON's 21st Cloud Expo, which will take place on October 31 through November 2nd 2017 at the Santa Clara Convention Center in Santa Clara, California. Opsani is creating the next generation of automated continuous deployment tools designed specifically for containers. How is continuous deployment different from continuous integration and continuous delivery? CI/CD tools provide build and test. Continuous Deployment is the means by which...