Microsoft Cloud Authors: Andreas Grabner, Stackify Blog, Liz McMillan, David H Deans, Automic 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.


  • 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.
  • 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.


  • 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).
  • 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.
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.


@ThingsExpo Stories
SYS-CON Events announced today that Cloud Academy named "Bronze Sponsor" of 21st International Cloud Expo which will take place October 31 - November 2, 2017 at the Santa Clara Convention Center in Santa Clara, CA. Cloud Academy is the industry’s most innovative, vendor-neutral cloud technology training platform. Cloud Academy provides continuous learning solutions for individuals and enterprise teams for Amazon Web Services, Microsoft Azure, Google Cloud Platform, and the most popular cloud com...
We build IoT infrastructure products - when you have to integrate different devices, different systems and cloud you have to build an application to do that but we eliminate the need to build an application. Our products can integrate any device, any system, any cloud regardless of protocol," explained Peter Jung, Chief Product Officer at Pulzze Systems, in this SYS-CON.tv interview at @ThingsExpo, held November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA
SYS-CON Events announced today that IBM has been named “Diamond Sponsor” of 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.
In his session at Cloud Expo, Alan Winters, an entertainment executive/TV producer turned serial entrepreneur, presented a success story of an entrepreneur who has both suffered through and benefited from offshore development across multiple businesses: The smart choice, or how to select the right offshore development partner Warning signs, or how to minimize chances of making the wrong choice Collaboration, or how to establish the most effective work processes Budget control, or how to ma...
With major technology companies and startups seriously embracing Cloud strategies, now is the perfect time to attend 21st Cloud Expo October 31 - November 2, 2017, at the Santa Clara Convention Center, CA, and June 12-14, 2018, at the Javits Center in New York City, NY, and learn what is going on, contribute to the discussions, and ensure that your enterprise is on the right path to Digital Transformation.
SYS-CON Events announced today that CA Technologies has been named "Platinum Sponsor" of SYS-CON's 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. CA Technologies helps customers succeed in a future where every business - from apparel to energy - is being rewritten by software. From planning to development to management to security, CA creates software that fuels transformation for companies in the applic...
Multiple data types are pouring into IoT deployments. Data is coming in small packages as well as enormous files and data streams of many sizes. Widespread use of mobile devices adds to the total. In this power panel at @ThingsExpo, moderated by Conference Chair Roger Strukhoff, panelists looked at the tools and environments that are being put to use in IoT deployments, as well as the team skills a modern enterprise IT shop needs to keep things running, get a handle on all this data, and deliver...
In his session at @ThingsExpo, Eric Lachapelle, CEO of the Professional Evaluation and Certification Board (PECB), provided an overview of various initiatives to certify the security of connected devices and future trends in ensuring public trust of IoT. Eric Lachapelle is the Chief Executive Officer of the Professional Evaluation and Certification Board (PECB), an international certification body. His role is to help companies and individuals to achieve professional, accredited and worldwide re...
Amazon started as an online bookseller 20 years ago. Since then, it has evolved into a technology juggernaut that has disrupted multiple markets and industries and touches many aspects of our lives. It is a relentless technology and business model innovator driving disruption throughout numerous ecosystems. Amazon’s AWS revenues alone are approaching $16B a year making it one of the largest IT companies in the world. With dominant offerings in Cloud, IoT, eCommerce, Big Data, AI, Digital Assista...
New competitors, disruptive technologies, and growing expectations are pushing every business to both adopt and deliver new digital services. This ‘Digital Transformation’ demands rapid delivery and continuous iteration of new competitive services via multiple channels, which in turn demands new service delivery techniques – including DevOps. In this power panel at @DevOpsSummit 20th Cloud Expo, moderated by DevOps Conference Co-Chair Andi Mann, panelists examined how DevOps helps to meet the de...
"When we talk about cloud without compromise what we're talking about is that when people think about 'I need the flexibility of the cloud' - it's the ability to create applications and run them in a cloud environment that's far more flexible,” explained Matthew Finnie, CTO of Interoute, in this SYS-CON.tv interview at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
No hype cycles or predictions of zillions of things here. IoT is big. 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, Associate Partner at M&S Consulting, presented a step-by-step plan to develop your technology implementation strategy. He discussed the evaluation of communication standards and IoT messaging protocols, data analytics considerations, edge-to-cloud tec...
IoT solutions exploit operational data generated by Internet-connected smart “things” for the purpose of gaining operational insight and producing “better outcomes” (for example, create new business models, eliminate unscheduled maintenance, etc.). The explosive proliferation of IoT solutions will result in an exponential growth in the volume of IoT data, precipitating significant Information Governance issues: who owns the IoT data, what are the rights/duties of IoT solutions adopters towards t...
With the introduction of IoT and Smart Living in every aspect of our lives, one question has become relevant: What are the security implications? To answer this, first we have to look and explore the security models of the technologies that IoT is founded upon. In his session at @ThingsExpo, Nevi Kaja, a Research Engineer at Ford Motor Company, discussed some of the security challenges of the IoT infrastructure and related how these aspects impact Smart Living. The material was delivered interac...
The Internet giants are fully embracing AI. All the services they offer to their customers are aimed at drawing a map of the world with the data they get. The AIs from these companies are used to build disruptive approaches that cannot be used by established enterprises, which are threatened by these disruptions. However, most leaders underestimate the effect this will have on their businesses. In his session at 21st Cloud Expo, Rene Buest, Director Market Research & Technology Evangelism at Ara...
When growing capacity and power in the data center, the architectural trade-offs between server scale-up vs. scale-out continue to be debated. Both approaches are valid: scale-out adds multiple, smaller servers running in a distributed computing model, while scale-up adds fewer, more powerful servers that are capable of running larger workloads. It’s worth noting that there are additional, unique advantages that scale-up architectures offer. One big advantage is large memory and compute capacity...
Artificial intelligence, machine learning, neural networks. We’re in the midst of a wave of excitement around AI such as hasn’t been seen for a few decades. But those previous periods of inflated expectations led to troughs of disappointment. Will this time be different? Most likely. Applications of AI such as predictive analytics are already decreasing costs and improving reliability of industrial machinery. Furthermore, the funding and research going into AI now comes from a wide range of com...
Internet of @ThingsExpo, taking place October 31 - November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA, is co-located with 21st Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. The Internet of Things (IoT) is the most profound change in personal and enterprise IT since the creation of the Worldwide Web more than 20 years ago. All major researchers estimate there will be tens of billions devic...
SYS-CON Events announced today that Enzu will exhibit at SYS-CON's 21st Int\ernational Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Enzu’s mission is to be the leading provider of enterprise cloud solutions worldwide. Enzu enables online businesses to use its IT infrastructure to their competitive advantage. By offering a suite of proven hosting and management services, Enzu wants companies to focus on the core of their ...
SYS-CON Events announced today that GrapeUp, the leading provider of rapid product development at the speed of business, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Grape Up is a software company, specialized in cloud native application development and professional services related to Cloud Foundry PaaS. With five expert teams that operate in various sectors of the market acr...