Java Plays Prominent Role at WWDC 2001by Daniel H. Steinberg
At Apple's Worldwide Developers Conference (WWDC 2001), Steve Naroff, Apple's senior director of Java technologies and core tools, gave developers an overview of Java support on Mac OS X. Naroff wants to be known as a developer too, and not just a director. So the introductory slide also listed him as "Dynamic Object Dweeb."
Looking back over the last six years, Naroff noted that a few things have changed. First and foremost, he said, there are no more excuses. No excuses from Sun and none from Apple. He said that the Java programming language is excellent, the APIs are becoming solid, and the tools are more robust.
While Steve Jobs has said that his goal is to make Mac OS X the best desktop for running Java, Steve Naroff adds the goal of making Mac OS X the best desktop for developing Java apps. To accomplish both, Apple engineers have worked at porting and enhancing Hotspot. (See the bonus coverage at the end of the article for more details.)
They've also added special packages on top of the standard Java 2 stack. Naroff was careful to point out that these packages shouldn't be interpreted as Apple being dissatisfied with Sun's offerings. Apple is adding value by providing a bridge (using JNI) between Cocoa and Java. Apple also offers the QuickTime for Java package. Finally, Web Objects is an extension that doesn't require native code and can run on other operating systems with Java 1.3 installed.
Naroff stressed the importance of having out-of-the-box Java support. The obvious advantage is that customers won't have the obstruction of an 8-Mbyte download to run Java apps. The more subtle advantage is that Apple engineers have enhanced the performance by sharing metadata across applications (again, see the bonus coverage).
Weighing richness with reach
Naroff then turned to the various options developers have for creating solutions. He suggested that they weigh the richness of the user experience with the reach of their application, and consider what is best in their specific case.
At one extreme, HTML provides a lot of reach, but limited richness. A Cocoa application, on the other hand, can be quite rich but is limited in its reach. Although disagreements between Sun and Microsoft have reduced the reach of Java 2 applets, Naroff sees these as three good alternatives that combine reach with richness.
Do you have any feedback concerning Java development on Mac OS X?
More Apple Worldwide Developers Conference Coverage:
As a second alternative, Naroff suggested a custom Java application on the client instead of an applet. For Mac OS X, he thinks that putting a Cocoa front-end on a client Java application will provide a rich solution with a lot of reach.
Bringing existing Java apps to Mac OS X
Sean Reilly, CTO of AppGen, demonstrated MoneyDance. This Java application is a fairly full-featured money management tool. Reilly ported his app to Mac OS X in about an hour. Actually, he explained, he didn't have to really port it. He just had to figure out MRJAppBuilder to create a clickable Mac application. He says he now develops the product entirely on Mac OS X.
What's coming down the road
The big question, of course, is what's coming next. The short answer is they won't really say much. This week, the developer preview 1 of 1.3 with applets will be available. Naroff predicts that 1.3.1 will ship in July -- less than two months after Sun shipped its version. Larry Abraham, Sun's director of J2SE, added that they expect Apple to be the first port of 1.3.1. Abraham then asked Naroff when Apple will ship 1.4. Naroff replied, "When will you?" Sun has announced a November ship of 1.4. Apple has not yet made an announcement.
The other hole in the announcements was support for J2EE. Naroff pointed out that there will come a time when Web Objects will need to address this to compete with other vendors. But, he said, Apple will continue to focus on the Standard Edition.
Bonus Coverage: The JVM News
Blaine Garst and his team outlined some of the features of Apple's implementation of the Java virtual machine (JVM). In addition to porting Hotspot from Sun, Apple adds better language integration with C and ObjC, better performance with lower memory requirements, faster launch times, and faster running times.
The reason applications run more quickly with Hotspot is that there is better garbage collection and memory management. This is due to the fact that most objects die young. An object that survives for a while will persist for a very long time and doesn't need to be checked on very often. Apple took this further and looked at optimizing objects that never need to go away. Some of these are read-only objects from the core library so they can be shared across applications. Apple has seen such performance improvements that Sun may include this technology in their 1.4 release.
Hotspot 2.0 from Java Developers Kit (JDK) 1.3.1 will actually be released in DP1 this week. You can use it from the command line by including the following option once you've installed DP1:
java -hs1_3_1 <classname>. In Hotspot 2.0, the debugger is fast and profiling works. There is a better register allocator as well. On top of that, Apple has added G4 accelerations to copy memory and has optimized
instanceof. Apple has also further improved Sun's register allocation for floating point.
Daniel H. Steinberg is the editor for the new series of Mac Developer titles for the Pragmatic Programmers. He writes feature articles for Apple's ADC web site and is a regular contributor to Mac Devcenter. He has presented at Apple's Worldwide Developer Conference, MacWorld, MacHack and other Mac developer conferences.
Return to the Mac DevCenter.