Welcome!

Microsoft Cloud Authors: David H Deans, Liz McMillan, Pat Romanski, Janakiram MSV, Jnan Dash

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
Your homes and cars can be automated and self-serviced. Why can't your storage? From simply asking questions to analyze and troubleshoot your infrastructure, to provisioning storage with snapshots, recovery and replication, your wildest sci-fi dream has come true. In his session at @DevOpsSummit at 20th Cloud Expo, Dan Florea, Director of Product Management at Tintri, will provide a ChatOps demo where you can talk to your storage and manage it from anywhere, through Slack and similar services ...
SYS-CON Events announced today that Ocean9will exhibit 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. Ocean9 provides cloud services for Backup, Disaster Recovery (DRaaS) and instant Innovation, and redefines enterprise infrastructure with its cloud native subscription offerings for mission critical SAP workloads.
The taxi industry never saw Uber coming. Startups are a threat to incumbents like never before, and a major enabler for startups is that they are instantly “cloud ready.” If innovation moves at the pace of IT, then your company is in trouble. Why? Because your data center will not keep up with frenetic pace AWS, Microsoft and Google are rolling out new capabilities In his session at 20th Cloud Expo, Don Browning, VP of Cloud Architecture at Turner, will posit that disruption is inevitable for c...
SYS-CON Events announced today that SoftLayer, an IBM Company, has been named “Gold Sponsor” of SYS-CON's 18th Cloud Expo, which will take place on June 7-9, 2016, at the Javits Center in New York, New York. SoftLayer, an IBM Company, provides cloud infrastructure as a service from a growing number of data centers and network points of presence around the world. SoftLayer’s customers range from Web startups to global enterprises.
SYS-CON Events announced today that Conference Guru has been named “Media Sponsor” of 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. A valuable conference experience generates new contacts, sales leads, potential strategic partners and potential investors; helps gather competitive intelligence and even provides inspiration for new products and services. Conference Guru works with conference organizers to pass great dea...
SYS-CON Events announced today that Technologic Systems Inc., an embedded systems solutions company, will exhibit at SYS-CON's @ThingsExpo, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Technologic Systems is an embedded systems company with headquarters in Fountain Hills, Arizona. They have been in business for 32 years, helping more than 8,000 OEM customers and building over a hundred COTS products that have never been discontinued. Technologic Systems’ pr...
SYS-CON Events announced today that CA Technologies has been named “Platinum Sponsor” of 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, and the 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 ...
With major technology companies and startups seriously embracing Cloud strategies, now is the perfect time to attend @CloudExpo | @ThingsExpo, June 6-8, 2017, at the Javits Center in New York City, NY and October 31 - November 2, 2017, Santa Clara Convention Center, CA. 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 Telecom Reseller has been named “Media Sponsor” of 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. Telecom Reseller reports on Unified Communications, UCaaS, BPaaS for enterprise and SMBs. They report extensively on both customer premises based solutions such as IP-PBX as well as cloud based and hosted platforms.
SYS-CON Events announced today that Loom Systems will exhibit 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. Founded in 2015, Loom Systems delivers an advanced AI solution to predict and prevent problems in the digital business. Loom stands alone in the industry as an AI analysis platform requiring no prior math knowledge from operators, leveraging the existing staff to succeed in the digital era. With offices in S...
SYS-CON Events announced today that Interoute, owner-operator of one of Europe's largest networks and a global cloud services platform, has been named “Bronze Sponsor” of SYS-CON's 20th Cloud Expo, which will take place on June 6-8, 2017 at the Javits Center in New York, New York. Interoute is the owner-operator of one of Europe's largest networks and a global cloud services platform which encompasses 12 data centers, 14 virtual data centers and 31 colocation centers, with connections to 195 add...
SYS-CON Events announced today that T-Mobile will exhibit 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 ...
In his session at @ThingsExpo, Eric Lachapelle, CEO of the Professional Evaluation and Certification Board (PECB), will provide an overview of various initiatives to certifiy 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 worldw...
SYS-CON Events announced today that Infranics will exhibit 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. Since 2000, Infranics has developed SysMaster Suite, which is required for the stable and efficient management of ICT infrastructure. The ICT management solution developed and provided by Infranics continues to add intelligence to the ICT infrastructure through the IMC (Infra Management Cycle) based on mathemat...
SYS-CON Events announced today that SD Times | BZ Media has been named “Media Sponsor” of 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. BZ Media LLC is a high-tech media company that produces technical conferences and expositions, and publishes a magazine, newsletters and websites in the software development, SharePoint, mobile development and commercial UAV markets.
SYS-CON Events announced today that Cloudistics, an on-premises cloud computing company, has been named “Bronze Sponsor” of 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. Cloudistics delivers a complete public cloud experience with composable on-premises infrastructures to medium and large enterprises. Its software-defined technology natively converges network, storage, compute, virtualization, and management into a ...
Now that the world has connected “things,” we need to build these devices as truly intelligent in order to create instantaneous and precise results. This means you have to do as much of the processing at the point of entry as you can: at the edge. The killer use cases for IoT are becoming manifest through AI engines on edge devices. An autonomous car has this dual edge/cloud analytics model, producing precise, real-time results. In his session at @ThingsExpo, John Crupi, Vice President and Eng...
SYS-CON Events announced today that HTBase will exhibit 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. HTBase (Gartner 2016 Cool Vendor) delivers a Composable IT infrastructure solution architected for agility and increased efficiency. It turns compute, storage, and fabric into fluid pools of resources that are easily composed and re-composed to meet each application’s needs. With HTBase, companies can quickly prov...
There are 66 million network cameras capturing terabytes of data. How did factories in Japan improve physical security at the facilities and improve employee productivity? Edge Computing reduces possible kilobytes of data collected per second to only a few kilobytes of data transmitted to the public cloud every day. Data is aggregated and analyzed close to sensors so only intelligent results need to be transmitted to the cloud. Non-essential data is recycled to optimize storage.
"I think that everyone recognizes that for IoT to really realize its full potential and value that it is about creating ecosystems and marketplaces and that no single vendor is able to support what is required," explained Esmeralda Swartz, VP, Marketing Enterprise and Cloud at Ericsson, in this SYS-CON.tv interview at @ThingsExpo, held June 7-9, 2016, at the Javits Center in New York City, NY.