Macworld report: Big news for Macintosh enthusiasts

Mac OS X will move Java on the Mac from also-ran to serious contender

In my dream, after I've just dropped off my kids at school, I sit at a local coffee shop with a perfectly brewed cup of Sumatran. I pull a new Titanium powerbook out of my bag and fire it up. Mac OS X loads in less time than it takes me to butter a blueberry muffin. I start up JBuilder4 and get to work on Java code that will drive a QuickTime application. I glance at my watch -- the G4 laptop's five-hour battery will have about three hours to spare on this morning. After an hour of solid development I realize that I haven't had to reboot the Mac once. I sigh and realize that the only thing wrong with my dream is that I'm in it.

When will the dream become reality? The Java news emanating from the Macworld Expo in San Francisco last week may shift Mac-based Java developers from REM sleep to a new awakening.

The keynote -- the core and the vision

At the Macworld Expo held in San Francisco from January 9-12, Steve Jobs, Apple Computer's CEO, described Mac OS X as having "the power of Unix with the legendary ease of use [of] the Mac." In a way, that's the Java proposition for the Mac. Much of the power of the Java implementation on Mac OS X comes from the Mach 3.0 microkernel and BSD operating system. Java applications will take advantage of solid thread support, protected memory, and symmetric multiprocessing.

Macworld is not really a show dominated by hard core developers. Instead, Mac developers will tend to go to Apple's Worldwide Developers Conference (WWDC) in May, while serious Java developers will often choose to attend JavaOne in June. Even so, the keynote audience applauded loudly as Jobs reviewed the new OS's core components, including an enthusiastic response to his reiteration that Apple would provide full support for Java 2 Standard Edition version 1.3 in Mac OS X.

Not forgetting the hardware side of the Apple equation, Jobs announced the new line of faster PowerMac G4s that boast clock speeds up to 733 MHz with a new 133 MHz bus. Because of chip availability, the models currently shipping will sport a single processor; you'll have to wait to see what the multiprocessor support in Mac OS X means to you, or you can take advantage of the fire sales that Apple is having on its existing stock of the current multiprocessor systems. The second hardware announcement featured the new G4 laptop. The new Titanium was Jobs's "one more thing" announcement.

Jobs also presented his vision for the future of the PC. He sees the new role of the PC as being the digital hub. He champions Apple's applications that allow users to import pictures from digital cameras and camcorders and create iMovies that can be written to DVDs. Positioning the Mac at the center of these small digital appliances is an interesting proposition for Java developers who can write to the Mac using J2SE and to these devices using J2ME.

The Java sessions

JavaWorld sponsored two Java-related events at last week's Macworld Expo -- Wednesday's "Java Advantages in the Mac OS X" and the "Java Report" held on Friday. Both sessions featured the important players on the Apple Java team, as well as audiences composed of serious Java developers. Although the sessions ostensibly focused on different Java-related topics, in practice they turned into a two-session discussion on the state of Java on Mac OS X. And the news was good.

The overview

Steve Naroff, Apple's senior director of Java support tools, delivered the overview. At last year's session, Naroff first announced Apple's plans for supporting Java 2 Standard Edition on Mac OS X while simultaneously enhancing support for Java 1.1.8 on the classic Mac platform. This year he reiterated Apple's support for Sun's standard APIs. Referring to the huge number of developers working in the Java language, he noted that even if you discount 90 percent of the code as not being top quality, Apple's Java support is designed "to take advantage of that non-sh** that's out there."

According to Naroff, Apple believes that Java is both a great platform and a great language, which is why Apple allows Java to access Cocoa -- the framework for native object-oriented development on Mac OS X -- at the same time that Mac OS X supports Java as a programming language for the Java 2 platform. Naroff explained: "If your design point is to write the world's best Aqua Mac OS X application, then Cocoa is the way Apple wants you to do that and Java is a great language for accessing it. If, however, your high order bit is to have a cross-platform application ... then Swing is what you might write to." He noted that Borland's JBuilder serves as a good example of a Java-written application whose byte code runs identically on all of the supported platforms.

Even Swing-based applications resemble Aqua when running on Mac OS X. According to Naroff, "Apple transforms a lot of the Swing widgets into Aqua widgets on the fly." He cautioned that on-the-fly transformation doesn't deliver 100 percent of the Aqua look and feel, but it gives developers a leg up, allowing them to tweak their applications to get the remainder.

Apple is looking at Java code sharing to reduce footprint and improve performance. As an example, Naroff suggested that two or more large Java applications (say the office suite from Think Free and JBuilder) could share the same Swing. However, while code sharing is common in the C world, he pointed out, "When you run multiple instances of a Java VM, the default is not to share code."

In past keynotes, Jobs has stressed Mac OS X support for OpenGL. In the sessions, Naroff, describing OpenGL support as an important optimization, added that, "We're going to integrate with OpenGL such that our Java can benefit from the hardware acceleration." As such, while it won't be the default in the March release, OpenGL support will require just a simple flip of the switch.

In other news, Apple is working with Microsoft to improve the Java support in Internet Explorer for the Mac. Indeed, the engineers have addressed many of the bugs evident when using IE on Mac OS 9. Naroff said that running more than one applet works on Mac OS X, with the remaining issues centering on aesthetics. He expects these will be cleared up by the March 24 ship date.

Naroff wrapped up by saying, "Out of the gate, Mac OS X will have four compelling environments" for Java development. If developers live in a command line environment, they can use vi or emacs and the Java command line tools for development. For those looking for a multilingual environment, Apple's Project Builder supports C, C++, and Java. Further, there's the traditional Mac IDE, Metrowerks's CodeWarrior. Finally, if developers simply want to do Java development, they can turn to Borland's JBuilder. All of which points to a great many more choices than Java developers have ever had for developing on the Mac.

Metrowerks's CodeWarrior

Metrowerks's CodeWarrior, the traditional development environment for work done on and for the Mac OS, was one of the early tools used for porting classic applications to Mac OS X. Randy Little, product marketing manager of desktop products for Metrowerks, says that the company's Java strategy aims to provide end-to-end support. Further, Metrowerks Media Manager Jeff Tieszen reported, "When OS X ships, our full Java support will be there, just as it was on Classic Mac OS."

Metrowerks is not ready, however, to completely support Java development on and for Mac OS X. CodeWarrior's RAD tools aren't yet in place and the support for the tools that target writing Mac OS X native applications aren't expected until May.

Now that Metrowerks is owned by Motorola, it will place emphasis on embedded products including J2ME support, emulation of various smaller devices, and a focus on the cell phone and PDA markets. A second goal for Metrowerks: beef up enterprise support with the next release of Java tools expected midyear.

Borland's JBuilder4

The JBuilder4 demonstration just blew me away. Forget for a minute what the product did and concentrate on what it is: a large application written entirely in Java. It looks great and runs fast on Mac OS X. Dispelling the myth that real Java applications are too slow and unresponsive, Blake Stone, chief scientist of Borland's Java business unit, contended that, "Java is tremendously fast."

Stone made it clear that his demonstration featured the shipping JBuilder4 byte code available on other platforms. This one happened to be running on the Mac OS X JVM with the Aqua look and feel. He illustrated the product's dynamic responsiveness by employing the source code editor to add a variable that instantly appeared in the structure pane. Because JBuilder4 does parsing on the fly, Mac-based Java programmers will get the code completion help they've come to love while developing on other platforms. Stone demonstrated a long list of features in the debugger, source code editor (including templates), and graphical design editor. What's exciting to Mac developers is that these tools that have been available on other platforms will now be available on Mac OS X.

QuickTime for Java

Apple's QuickTime for Java Engineering Manager, Bill Stewart, performed two demonstrations. The first showed a Java application employing a live camera broadcasting with QuickTime. A second machine opened a QuickTime movie and showed that it was receiving the live feed. The broadcast APIs are not shipping on Windows machines. His second demo showed Java code embedded in a QuickTime movie. This enables you to have Java code (from any of the standard APIs except AWT) executing at runtime and interacting with the movie.

Apple has updated QuickTime for Java to the current shipping version of QuickTime 5. Stewart mentioned that his team has "integrated some of the QuickTime for Java and QuickTime stuff to Swing components and we've seen improved performance there." Further, he noted that because Java is a great language to work with, it makes sense to provide a Java API to the core audio and MIDI services shipping with Mac OS X. In addition, the QuickTime team plans to add Java access to layers on top of MIDI, including software synthesis technology. Stewart explained that there will be strong support for the basic audio services needed by developers of games and audio-intensive applications.

Questions and answers

Responding to questions about Java 3D and Java Web Start, Naroff said that both have been ported to Mac OS X. He said that Sun would like to see the Java 3D API bundled with Mac OS X and that, although it won't make it into the March 24th release, Apple is working with Sun to include it in a future release of OS X.

To reassure one questioner who pleaded for Apple to keep Mac OS X Java releases close to the Sun releases, Naroff said that the company would try to do so. In fact, he said, Apple looks forward to the day when it leads in some areas. He further informed the audience that Sun is looking to integrate the code sharing Apple developed. He smiled at the prospect of having developers ask Sun when it will include various features from Apple.

One intrepid audience member asked what the Mac OS X Java implementation doesn't include. The answer: other than the issues discussed above, Java application launch time remains slow because Java does everything very dynamically. As Apple engineer Blaine Garst explained, "Java will fire up and run in about half a second. Bringing the GUI up is where a lot of tuning needs to be done."

Conclusion

It's been a long time coming, but strong Java support on the Mac has arrived with Mac OS X, along with a variety of tools for Java development. Both the look and the feel, along with the performance, of Java applications are impressive. Whether you agree or not that Apple has achieved Steve Jobs's JavaOne promise of making Mac OS X the best Java platform on the planet, you will be amazed at how far it's come.

Daniel Steinberg is the director of Java Offerings at Dim Sum Thinking, Inc. He learned to program in C and C++ on a Macintosh to help his research on elastic curves in hyperbolic space. Object-oriented design is the way in which mathematicians view the world, and so programming in Java was an obvious next step. Daniel teaches courses in Java and object-oriented architecture and design. He cowrote the Java 2 Bible, published by IDG Books. He thinks that the first words spoken by his daughter Maggie Rose were "my Mac" -- his wife thinks Maggie was saying "Mama." Maggie knows that she was asking clearly for an "iMac" and that she prefers Tangerine. Her younger sister Elena can't speak yet, but she keeps pointing to the Titanium powerbook.
Related:
1 2 Page 1