Search |
|||||
Java on Vista: Yes, it WorksPosted by chet on October 6, 2006 at 2:23 PM PDT
The RumorHey, I like a rumor as much as anybody (Hey, did you hear that Larry Ellison is acquiring Europe?). But when the rumor is clearly wrong and it involves a project that I'm actually working on, I feel obliged to correct the misinformation (as did Java 2D's Dmitri Trembovetski, who has responded to the relevant threads in the next paragraph. Go Dmitri!). There was a post on Microsoft Watch, Windows Vista: Aero Glass and Java Don't Mix, last week that claimed that Java does not work on Windows Vista. OSNews also picked it up. Then Javalobby picked it up on a forum entitled "Running Java on Vista Disabled Aero/Glass UI Effects". Imagine my surprise when I received the Javalobby newsletter with the subject "Java and Vista Not Playing Well Together". I especially love this quote on Microsoft Watch: Sun Microsystems would do well to give a ring to one of the interop contacts at Microsoft that came out of the firms' historic make-nice agreement back in 2004, and figure out how to make Java apps first-class Vista citizens. Thanks for the tip, Jason; I'll pick up that phone right now... So: Is the rumor true? Did Sun actually forget about Vista ("Whoops!") completely? The TruthNope. The rumor is not true; we actually work great on Vista. (The rumor about Larry, on the other hand...). In fact, we have been tuned into this release and making Java 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, and regular testing and engineering during Vista's development, we have been building a rock-solid release of Java for Vista. So how did this bizarre rumor originate? Well, older versions of Java do have problems on Vista, and that's what the original report was about; someone tried running some older version of Java on Vista and noted some problems. But that's like saying 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? Presumably, given the popularity of Bloody Mess X, the developers are working on a port of the game to the new console ("Even more blood!"), so you will still be able to run your favorite game on this new system. The port is the key; the new system is different enough in its fundamentals that software for the older system would not just work, but had to be ported. It would be great if your game just worked. Just like it would be great if Java just happened to work on Vista with no changes. But it just didn't happen that way; the platforms are different enough that changes are necessary. It's the same thing here; 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 where the system has changed, and need to react to those issues. In our case, Java is not just a simple win32 GUI application; it is a runtime platform with deep rooted needs in the operating system, the networking stack, the security model, the graphics system, ... if any of these change significantly, then we need to change our software in reaction. And in the case of Vista, it has been an ongoing process of learning, testing, debugging, submitting bugs against Microsoft, fixing our bugs, re-testing, .... And since Vista has been a moving platform during the Java SE 6 development process, we've been in this development cycle continually with every new drop of Vista (they are still releasing weekly builds for us to test; we just found a bug in RC1 that has since been fixed in the latest release we got yesterday). But the extra hassles of debugging a moving platform does not mean that we are unaware of the issues and haven't actually been fixing them; 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 Java 2D's disabling the Aero Glass whizzy desktop management system) have been fixed and available in snapshot releases of Java SE 6 for many months. And as we fixed problems in Java SE 6 (our primary platform for Vista support), we have also been backporting the more important fixes to older releases so that we can provide updates to these releases for customers that 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. These are screenshots of Java GUI applications running on the latest versions of Vista (two of the SwingSet2 demo, one of Azureus, and one of Swing-based NetBeans 6):
The Problems We FixedSince this is a tech blog (okay, apart from the occasional geeky humor tangents, like this, this, this, and this) and not a whitepaper, I get to dive into a little more detail than I would otherwise. In a whitepaper, we might say something like "We work 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 I'm thinking that Java developers might actually be interested in some of the technical details that we had to deal with to make our stuff work on Vista. Those looking for things to occupy their time can chase down the real details in our bug database, of course, but I'll hit some of the highlights here: Aero GlassThe "Aero Glass" desktop is enabled by the Desktop Window Manager (DWM) of Vista. This system runs the desktop graphics on top of Direct3D. All "windows" on the desktop are actually texture maps which 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
Problem 2: Graphics artifacts (black rectangles)
Swing Native Look & FeelVista has a completely new look & feel. Beyond the Aero Glass effects discussed above, there are simply new themes and new looks to the buttons, the windows, and all of the other normal desktop widgets. But Vista did not simply tweak the XP look & feel resources; they implemented these new looks through a completely different mechanism. And they added animation to some of these widgets. 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
Problem 2: Native look & feel animation
DeploymentOne of the more major areas of change in Vista affected the deployment team. 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 areas of problems that we had to overcome. Problem 1: Administrative Privileges RequiredThere were many cases in which we need administrator privileges in order to perform a necessary deployment task. This includes storing things to registry keys, writing to locations on disk, and executing processes.
Problem 2: IE7 SandboxIE7 on Vista is really clamping down on security holes, but restricting access to the filesystem from the browser process and everything associated with it. This means that Java Plug-in, which runs as an ActiveX control within IE7, is wholly contained within that IE7 sandbox. This has various implications, from the ability to save into arbitrary locations to the ability to read from and write to the normal deployment installation directory (which Java Plug-in shares with Java Web Start).
Problem 2a: Vista and IE7 Sandboxes: The UnfixableThere is an issue worth noting here than cannot be fixed: IE7 on Vista will not let us access the file system outside the IE7 sandbox for applets. This means that even "signed" applets have no permission to write to arbitrary locations on disk. This behavior differs from the old behavior of applets on Windows, but given the restrictions of IE7, there is really no way around the problem. Applications will need to adjust and write to locations that are reachable from their applications. Note that if an applet simply needs to save information and access it later, this is completely possible; the information will reside in the sandboxed area of the browser. But if they want to save information in a place that is accessible by other applications, that is trickier since applets cannot save outside of this area and the area may not be obvious to applications outside the browser. There is another related issue also worth noting: Vista itself has proclaimed various directories off-limits for writing. For example, it is no longer possible (or at least no longer trivial) to save files to the root directory (C:\) or to other system-level folders; non-administrator users are typically restricted to writing only within their home directories. This change will affect not only applets, like the IE7 sandbox constraints noted above, but also standalone and Java Web Start applications. This is obviously not a Java-specific problem, but is one that our users must deal with just like they will have to deal with it in other native applications; files must be saved in Vista-friendly locations. Problem SummaryThat's it for the techy details. Hopefully you found it interesting; my purpose in detailing this stuff was not to bore or frighten you with the details, but rather to interest you in the relatively huge changes that Vista required from us, and to show why simply running out of the box on Vista was not really feasible for such a large and diverse platform as Java. But, again, we did the work, we work well, and we encourage you take the time to run Java SE 6 on Vista to see how well it all works together for your applications. The PlanMany people reading this might be wondering about things beyond the bugs we fixed, for example: "When can I get a release of Java that works well on Vista?". Well, here is the plan. Java SE 6 is the Best Solution for VistaFirst of all, you should note that the primary delivery of Java for Vista is Java SE 6; that release has received most of our focus during the Vista beta release timeframe, and it is where most of the fixes to the known problems currently reside. We are just finishing up that release and it should be done and shipping by sometime next month.* In the meantime, we encourage you to go to the Java SE 6 download site and get the latest snapshot for testing; the release is pretty close to final, so it is working very well at this point. In particular, all of the serious Vista problems have been fixed in this release for months, so it is a particularly good test vehicle for Java on Vista. It is also worth mentioning that we are still aggressively pursuing OEM deals. We have distribution agreements with over 20 PC manufacturers, including all the top 10. They have all been helping us test Java SE 6 as they prepare their new lines of Vista-based systems for shipment, so that Java SE 6 will just be there on any of their new systems running Vista. By the way; if you have a local PC maker who you prefer over the big guys (or if that is your business), let them know they can sign up to bundle Sun's Java Runtime on their systems, just like Dell, HP, Sony, and all the others do just by going to http://java.com/pcoem. J2SE 1.5 Will Also WorkMany of the Vista fixes have already been, or will soon be, back-ported to J2SE 1.5. However, don't look for everything to work exactly the same; our primary focus was to make Java SE 6 the main release vehicle for Vista. In an ideal world with infinite engineers working on everything, perhaps we would make sure everything worked the same everywhere. But here in the Real World, we have to pick our battles, and the battle we picked this time was to make the new release the primary one for Vista. Besides the effort of simply moving code back and forth between releases, there are architectural differences between some areas of the current and older releases that makes porting efforts more difficult and time-intensive, so we carefully choose what to back-port, based on a cost-benefit tradeoff. J2SE 1.5 should work fine, but there may be some nuances that may not be as perfect. For example, the basic Swing native look & feel work has been back-ported, so that Swing native look & feel applications look like native applications on Vista; however, some additional Vista-specific fixes in this area (such as component animation) may not be back-ported, so the fidelity may not be as close as that in Java SE 6. Some of the Vista fixes are already in the current release of J2SE 1.5 (as of this writing, update 9 is available on the java.sun.com download site ). For example, the "Aero Glass" issues described above were addressed way back in update 8. But the full gamut of Vista work that we feel is necessary for J2SE 1.5 should be available in update 11, which we hope to release around January of 2007.* J2SE 1.4.2 Will Basically Work...We plan to also backport necessary fixes to 1.4.2. However, the same caveat goes for 1.4.2 that I detailed for 1.5, but even more so; we plan to fix only the necessary items to make 1.4.2 work on Vista, not to spend much time improving upon the basics. A good example is native look & feel. The rearchitecture of Swing's native look & feel engine involves a lot of code; we do not feel that it is worth the time and risk porting this code to this older platform with Java SE 6 being the primary release vehicle. We see 1.4.2 as being functional, usable, and perfect for situations where a customer is absolutely locked into that particular release for now. But we encourage developers and customers to migrate to a more full-feature Vista release soon. We plan to ship this Vista-enabled update of 1.4.2 sometime following the Vista release of J2SE 1.5. I hope this will be in the first quarter of 2007*, but details are still being nailed down. Our primary focus now is on finishing Java SE 6 and making it a stellar release, then jumping immediately onto the J2SE 1.5 update to make sure that it has the Vista support it needs. Then when we are satisfied that these vehicles are robust, we can address Vista on J2SE 1.4.2. * Don't quote me too exactly on dates. First of all, I'm an engineer. You should really talk to a business person that does this kind of stuff for a living if you want official dates and commitments. These dates are pretty solid based on our schedules and projections, but you're a software person (aren't you? how'd you get to this blog otherwise?) and understand that software release dates, like flies on your lunch, can move quickly as you get close to them. »
Related Topics >>
Java Desktop Comments
Comments are listed in date ascending order (oldest first)
|
|||||
|