March of the Mac IDEs

Four Java development tools for Mac compared

When the first alpha versions of Java hit the Internet, developers who chose to work on the Macintosh platform felt more than a little left out. Soon, there were beta versions for Solaris, Windows 95, and Windows NT, but still only the vaguest of promises from Sun that a version for MacOS 7.5 was in the works. Nearly every day, it seemed, someone would post a message to the comp.lang.java newsgroup asking whether there was a version of Java for the Macintosh. (Such postings were met with angry responses from non-Mac-oriented readers as the months wore on.)

When I wrote my first Java applets, the only way I could see them run from home on my Power Mac was to use X server software over my 14.4 kbps modem connection to a university SPARCstation running Solaris. Fortunately, Mac users no longer have to use this method to develop and run Java applications and applets, thanks to four currently available tools: Natural Intelligence's Roaster, Sun's Java Developer's Kit, Symantec's Café, and from Metrowerks, the Java component of CodeWarrior. To varying degrees, all of these packages are either beta versions, "developer releases," or simply beta-quality software labeled as a final release (see Truth in advertising, below).

Regardless of where the blame for the delay lies (see JavaWorld editor-in-chief Michael O'Connell's May 1996 editorial), Java has been a long time coming for the Mac. As new technologies have become ascendant in the past few years, Mac users have become accustomed to waiting just a little longer than everybody else. When it comes to Java, Mac users are finding that if they want to live on the "bleeding edge" of technology, they must also be prepared to bleed a little more profusely than everybody else.

The tools

Natural Intelligence's Roaster DR2

The product comes on CD-ROM and sells for a hefty 99, but if you qualify for an educational discount you can get it for 9. The purchase price includes all developer releases, as well as Release 1 and Release 2, shipped on CD. The basic subscription model is similar to that pioneered by Metrowerks with its CodeWarrior product.

Important! See Update.

Sun Microsystems' JDK 1.0.2 for MacOS

Released in beta form a few weeks after Roaster hit the scene, and on the other end of the price spectrum, is Sun's Java developer's kit (JDK), which is available for download at no charge from the JavaSoft Web site at http://www.javasoft.com/java.sun.com/products/JDK/index.html. Now at version 1.0.2, the kit includes four applications: a Java compiler, an applet viewer, Java Runner (an interpreter for running Java stand-alone applications), and JavaH (a utility for generating header and stub files for native methods written in C).

The JDK is not  an integrated development environment, and is not to be confused with SunSoft's Java WorkShop, an IDE currently available in beta only for Windows 95/NT and Unix, but expected to be available for the Mac well before hell freezes over, and perhaps even sometime this year. (Though originally scheduled for release this summer, Java WorkShop for the Mac has been put on the back burner at SunSoft while kinks in the non-Mac versions are ironed out.)

In a sense, I'm comparing apples and oranges by including the JDK in this review, but I think it's important for Mac developers to be aware that they can get started with Java without buying expensive tools, provided they are willing to make some significant sacrifices in terms of convenience.

Symantec's Café DR2 for Macintosh

Café currently ships with a preview version of Café Studio, a tool for visually constructing applet Graphical User Interfaces (GUIs).

Café DR1 shipped on CD-ROM; the latest version (DR2) can be ordered online and downloaded directly from the Internet but is not currently slated for pressing on CD. (Registered owners of DR1 may upgrade to DR2 by downloading it from the Web.) Café carries a price of 9. Those who have been following the IDEs closely may recall that 9 was originally announced as an "introductory" price, with an expected increase to 99 after July 22, 1996. Recently, however, Symantec decided to scrap the price increase and stick with the more competitive 9 price tag for Café.

Registered users of Café get one year of free updates via the Web -- free, that is, if you don't count the download time for the updates, which may be as large as 12 megabytes.

Metrowerks' Discover Programming with Java, CodeWarrior Gold 9

Metrowerks, in late 1995, was among the first to announce plans to release Mac tools for Java; to a degree, Metrowerks set the agenda by announcing that Java support would be included in CodeWarrior 9, so that developers whose existing CodeWarrior subscriptions (from versions 7 or 8) already entitled them to the version 9 update would get the Java tools at no additional charge. I reviewed Metrowerks' Discover Programming with Java, a Java-only version of Metrowerks' CodeWarrior IDE, bundled with an electronic version of Barry Boone's Learn Java on the Macintosh (published by Addison-Wesley, and commissioned by Metrowerks exclusively for inclusion in the Discover Programming package). The book is aimed at those with little or no programming experience who want to get started with Java.

CodeWarrior, a multilanguage, cross-platform IDE, supports a modular, "plug-in" architecture. Not to be confused with Netscape plug-ins, each of CodeWarrior's plug-ins provides support for a different language or platform. In this way, the CodeWarrior development environment may be configured to work with new languages or platforms through the addition of new plug-ins. Metrowerks' Java tools for CodeWarrior 9 consist essentially of the Metrowerks Java plug-in for compiling Java, and the Metrowerks Java application, a Java interpreter.

Discover Programming with Java comes on CD-ROM, sells for 9, and includes all of the same Java tools as CodeWarrior 9. The full CodeWarrior 9 Gold package, priced at 99, includes compilers not only for Java but for Object Pascal, C, and C++ as well; it will create code for the Java virtual machine (JVM), Mac 680x0, PowerMac, Windows 95/NT, Be OS, Magic Cap, and now MIPS (support for the latter is still in beta.) If you buy the full CodeWarrior Gold package, you get two free updates shipped on CD. The updates come out regularly in January, May, and September. (Note that if you buy Discover Programming, you don't get any free updates other than the free patches that Metrowerks periodically posts to its Web site -- unless you decide to upgrade to Gold. The upgrade cost is equal to the difference in price between the products.)

The roundup

Criteria

In reviewing any product for the Macintosh, one of the most important criteria is the quality of the user interface. If it's going to run on a Mac, it had better look, feel, smell, and taste like a Mac, or Mac users will be instantly turned off. I divided the user interface into five sub-criteria: editor, project manager, class browser, debugging tools, and visual GUI-building tools.

As with any development tool, performance is a key issue as well. This I divided into three sub-criteria: compilation speed, run-time performance (of the virtual machine), and overall stability of the product.

Like the Java language itself, Java tools have gradually "trickled" into existence, rather than appearing on the scene in a sudden flash. As a result, the users of these tools -- especially on the Mac -- have been forced to be patient, waiting for full implementations to appear, while they make do with products that make good on some subset of their ultimate promises. In the section called "Completeness of implementation" I discuss the thoroughness with which each product implements Java on the Macintosh, including the API, support for Java stand-alone applications, support for native methods, and support for 680x0-series Macs, such as the Quadra, Performa, and PowerBook 500 series.

Documentation also is important. Despite the similarity of many Mac IDEs, each has its unique quirks. Furthermore, the unique characteristics of the Java language mean that even your old faithful development environment may handle things a little differently when it comes to Java; good documentation is essential.

When even the documentation can't solve your problem, you may find yourself turning to the vendor of the product for technical support. I phoned the makers of all of these tools -- except Sun -- for technical support. Below, I'll tell you whether I got through or gave up.

As I stated previously, all of these tools are still in some form of pre-release stage. Had the designers of Java foreseen the volume of vaporware and other flatulence to which the language would give rise, perhaps they might have named it for some other species of bean. In "Future prospects," I'll tell you what each IDE vendor says is coming down the pike.

Finally, there is the issue of truth in advertising. Although I don't think anyone here has done anything to merit prosecution, there is a certain degree to which all of these companies have been guilty of stretching the truth a little in order to convince you to choose their product over the others. Ultimately, it's up to you to decide whether these tactics have an influence on your purchase, but you owe it to yourself to know the facts before you buy.

User interface

Editor

All three of the IDEs have high-quality, syntax-sensitive editors, complete with the standard features you'd expect in any Macintosh text editor: search and replace, regular-expression searching, configurable fonts and colors, auto-indent, pop-up menus with all of the methods in the current file, and so on. The Metrowerks and Symantec editors allow you to split a window into multiple horizontal and vertical panes. Roaster allows you to split a window into at most two horizontal panes.

Despite its limitation on panes, Roaster's editor boasts the most features, including support for named clipboards, smart macros, and various unique search-and-replace options. Additional features of Roaster's editor include the ability to click on the name of any class in the editor and have the editor automatically find the definition for that class.

I'd like to see Natural Intelligence expand the named-clipboard feature. It would be useful, for instance, for Roaster to ship with several pre-installed named clipboards corresponding to the event-handling methods in java.awt.Component, or to commonly used code fragments, such as an applet that extends java.lang.Runnable.

Roaster's configurable toolbar is quite an impressive piece of work. In addition to customizing and rearranging the items on the default toolbar, users may add new items to the toolbar as they are made available by Natural Intelligence. Particularly useful are the well-designed "New Class" and "New Method" wizards, included in the release, but -- oddly enough -- not part of the default toolbar.

Although the Sun JDK does not come with an editor, the Java compiler application that comes with the JDK supports hooks into a few other editors, so that, for instance, when the compiler flags an error, you can go instantly to that error in the editor. Supported editors include SimpleText, BBEdit 3.5, CodeWarrior, the Symantec Project Manager, and Roaster. I would have preferred to see the JDK Java compiler allow you to choose any editor with Apple Event support, such as Pete Keleher's superb shareware editor Alpha; for several months this was the only text editor on the 68k platform to support Java-sensitive syntax coloring.

Project manager

Café, CodeWarrior, and Roaster each provide a project manager, in which you group files for compilation. The project manager takes care of analyzing relationships and dependencies between files, avoiding the need for Makefiles of the type used with typical Unix-style command-line compilers. All three project managers support dragging of files and folders from the Finder to add them to the project and the opening of files by double-clicking them in the project manager.

The Symantec Project Manager (SPM) is the most flexible of the three, allowing hierarchically nested groups. It even allows you to nest projects within other projects. You may have more than one project open at a time, allowing you to drag and drop items between projects, a feature also found in Roaster but not in the Metrowerks IDE.

Roaster's approach to organizing the project manager is somewhat less flexible, but it has its advantages. Instead of giving you control over (and responsibility for) grouping items in the project manager, Roaster automatically creates groups according to the package statements in your Java source code, providing a direct and automatic mirroring of the structure of your code. If you wanted to mimic this effect in Symantec's or Metrowerks' project manager, you'd have to do it yourself, which is a bit of extra work.

Roaster's project manager also offers the highly convenient feature of having a pop-up menu attached to each source file, displaying all of the methods contained therein. This pop-up menu is available as soon as the file is added to the project, and is automatically updated as you edit your code; you don't have to run a compile in order to enable it. This feature is unique to Roaster.

One disadvantage of Roaster's project manager is that it does not give you a means to automatically "remove binaries." If you want to assure a clean build from scratch, you have to manually remove the .class files in the Finder. Both Café and Discover Java offer a convenient menu command to do this automatically.

Sun's JDK, of course, does not have a project manager, but if you keep your packages in places that make sense relative to the file you are compiling, or if you set the CLASSPATH variable appropriately (not so easy on the Mac JDK), the compiler will do a pretty good job of finding the files it needs and checking dependencies for you.

Class browser

All three of the IDEs provide a Smalltalk-style class browser, an approach to editing that harmonizes well with the object-oriented nature of Java. The differences in the browsers are largely trivial.

Roaster's is accessible from a nested submenu of the New... item in the File menu. This seems a less intuitive choice than the Window menu, which is where the other IDEs put it. In Metrowerks, although the browser is accessible from the Window menu, this item is grayed out unless you have checked the "Activate Browser" item in the Preferences dialog. This checkbox is unchecked by default, and checking it requires that you recompile your project before the browser item can be enabled in the menu. If you don't look carefully, you might get the mistaken impression that the class browser was an aspect of the CodeWarrior IDE that is not implemented for Java. All three IDEs allow editing of source code directly from the browser.

In addition to a class browser, both Roaster and Café also include a class tree, a feature not provided by CodeWarrior. Café's class tree is integrated into its class browser window, which is completely configurable. The Roaster class tree, also accessible from a nested submenu of the File menu, is a separate entity from the class browser, although it includes a browser-like section for class information. Roaster's class-browsing windows are generally less configurable than Café's, but Roaster does a much neater job of drawing the class tree itself, using non-intersecting perpendicular lines to connect the classes. It allows you to collapse the hierarchy at any node for less cluttered viewing.

Debugging tools

Debugging tools are an arena in which all three IDEs begin to smell of vaporware. All three companies claim that source-level debugging tools are just around the corner. Roaster's source-level debugger almost works in the current release (but not quite, especially on 680x0 Macs). The next version of Roaster, DR2.1 (to be released by the end of the summer), is expected to have a more fully-functional debugger.

Symantec has included a debugger in Café DR2, but it, too, lacks important functionality, such as the ability to remember breakpoints. It also crashes occasionally.

The Metrowerks debugger is not fully completed either. Instead of working from directly inside the IDE, you must launch a separate application, called MW Debug/Mac OS 1.5b2, which allows you to set breakpoints, and then run your applet or application with the Metrowerks Java interpreter. This is not at all intuitive, especially if you are used to CodeWarrior's normally smooth debugging process; indeed, the release notes claim that this is a temporary situation and that it will be fixed in future updates. Once you've got the debugger running -- not an easy task in its current incarnation, and with its current documentation -- it proves itself to be a well-designed, extremely useful tool, leveraging the quality of Metrowerks' existing Mac debugger.

The Mac version of the JDK does not come with any debugging tools at all, nor has Sun promised a Mac version of jdb, the command-line debugger that comes with Unix and Windows versions of the JDK.

Visual GUI-building tools

Symantec's Café Studio, which allows you to visually construct applet GUIs, is the only tool of its kind currently available for the Macintosh. Natural Intelligence has promised "visual tools," but the exact nature of these tools has yet to be revealed. No such tool is currently promised by Metrowerks, although it is likely that such a tool will be included by the time CodeWarrior 10 is released in September. (Still, this doesn't help you if you only own Discover Programming, which doesn't include major updates.)

Symantec concedes that Café Studio is a work in progress and that it is of pre-beta quality at its currently-shipping version, 1.0d2. It does not currently support all of the AWT widgets, the most noticeable omissions being Canvas and multiline TextArea widgets. Café Studio is provided in its current version in order to speed up the process of designing the simplest GUI components, and its output is Java code that you can edit, as long as you only type between the special comments that the Studio application places in the code.

From a user-interface point of view, some cosmetic changes in Café Studio would make it easier to use. For example, when you select a GUI item on the screen, it has only one handle for resizing, located in the lower right-hand corner. A better idea would be a handle at each corner, and on the sides as well, for flexible editing. This was apparently a shortcut for designing the product, since AWT widgets are placed via four variables: the ( x, y) coordinates of their upper-left corner, their width, and their height. Nonetheless, there is no need to translate this restriction to the user interface of a visual tool. Small things like this, and the fact that Studio only gives you a one-line text entry to define code for a widget's behavior in response to events, give Studio a clunky user interface. It would also be nice to see Symantec design some custom, composite widget classes for the final version of Café Studio, such as scrollable canvases, GIF buttons, or animations.

Studio has potential, but in and of itself it's not a reason to buy Café. Symantec deserves some credit for being the first to make such a tool available, but it's not really useful yet, except perhaps for the most rudimentary form-style interfaces. In the meantime, it seems likely that Café Studio is going to be discontinued in favor of a separately priced product called Visual Café. Although Symantec had initially promised that the Windows and Macintosh versions of Visual Café would be available simultaneously, lately the company has been noticeably silent with regard to this plan. The Windows version is promised by the end of July. If past performance is any indication, we can expect to wait a little longer for the Mac version.

Performance

Compilation speed

Sun's javac compiler is written in Java. Naturally, this means that its performance is going to be slower than a compiler that is executed at native speed. The JDK obviously uses javac. Metrowerks uses a version of javac hosted inside a plug-in for its modular architecture.

Both Symantec and Natural Intelligence, on the other hand, have written their own Mac-native Java compilers from scratch and give you the option of using either javac or the native compiler. In the case of Roaster, however, you really don't have a choice. Roaster's native compiler was described by the release notes in Developer Release 1 as "icky." You are warned that it tends to crash, and indeed, that's exactly what it does, even in Developer Release 2. The good news is that Roaster's version of the JVM is so efficiently implemented that using javac does not set you back all that much. Metrowerks also has a highly efficient virtual machine implementation, and in my tests it demonstrated nearly identical compile time to that of Roaster when using javac.

Café's native compiler represents the fastest method available of compiling Java on the Mac. On the other hand, if you use the javac option in Café, it runs significantly slower than any of the others. It's important to note that although Café's native compiler is the fastest one available, the current version cannot necessarily be counted on to produce correct Java bytecode. At least one reproducible bug, relating to bitwise operators (in particular &, |, and ^), has been discovered. Whenever these operators are used in an expression with the constant 1, Café's compiler generates erroneous bytecodes. Symantec has apparently developed a fix for this error but has not yet made it available to the public. For further updates regarding this issue, your best bet is to keep an eye on the comp.lang.java newsgroup.

The following table contains compile times, in minutes and seconds, for a fairly small sample applet I wrote (about 1,000 lines), consisting of nine classes in six files, five of which belonged to a package of their own:

Roaster JDK Café Metrowerks
Native Compiler crashed-0:41-
javac 0:571:141:340:59

Note that none of the tools give you an easy, built-in facility for measuring compile time. Since Roaster, Café, and CodeWarrior are all scriptable, I could have written AppleScripts to run and time the compiles, but this method would have excluded the JDK, which is not scriptable. Instead, I took the easy way out and used a stopwatch. All tests were done on my Power Mac 7100/66 with 24 megabytes of RAM. These are by no means exhaustive tests, and I have no doubt that others may find differing results using different benchmarks.

Run-time performance

Each of the tools provides its own implementation of the JVM. The JVM is the software entity that reads and executes platform-independent Java bytecodes. Each time it executes a bytecode instruction, it has to do extra work to translate that instruction into native code that can be run on the client platform. In DR2 of Café, Symantec has included a just-in-time (JIT) compiler (PowerPC only), which aims to significantly improve the run-time performance of Java by translating bytecode into native code as each bytecode file is loaded. Although the translation step delays execution of the code, it is only a one-time performance hit, typically outweighed by the benefit of running the code at native speed. Café currently sports the only JIT for the Mac. Natural Intelligence is working on a JIT for Roaster, but it is not yet available.

It's important to put performance of the virtual machine (VM) into perspective. Since Java applets are typically developed to run on someone else's physical machine, inside a Web browser, the speed of the virtual machine on the development platform is irrelevant to the end user. However, if you're compiling with javac, then VM performance is very important to you, because it affects your compile time. Also, if you're testing your applets on a very fast VM, you may be unaware of performance issues that arise when your applet runs on a slower VM, such as the one currently built into Netscape. So, although performance of the VM is not the most important factor in choosing an IDE, it's still worth knowing where each implementation falls in terms of performance.

Performance of the VM -- like that of any hardware CPU -- is highly benchmark-dependent, and to my knowledge, a full suite of benchmarks has not yet been developed for objectively evaluating the performance of implementations of the JVM. In an effort to obtain some sort of objective result, I added four lines of code to Sun's Fractal demo applet. The added code simply times the applet's run() method, and prints the result on the standard output. I then compiled the applet and ran it on all four VMs. I also ran it on Netscape Atlas Gold PR2 for the Macintosh. All tests were done on my Power Mac 7100/66 with 24 megabytes of RAM. Again, these tests are by no means exhaustive.

Time (milliseconds)

Roaster

3616

JDK

5573

Café

7990

Café (with JIT)

5853

Metrowerks

6121

Netscape Atlas PR2

10634

Quite surprisingly, both Roaster's virtual machine and that of Sun's JDK outperformed Café's just-in-time compiler on this particular test. Representatives from Symantec are fond of ridiculing Natural Intelligence's claim to the fastest virtual machine around, illustrating their point by racing Café's JIT against Roaster's VM -- a slanted comparison to begin with, especially given their choice of benchmarks: a group of sorting algorithms that each require only one class to be loaded. My measurements illustrate that the benefits of just-in-time compilation are dependent on the individual application in question.

Although this test does not disprove the usefulness of JIT compilation, it lends support to NI's claim that Roaster's virtual machine is the fastest implementation available on the Mac platform. Very likely, this is why Apple has chosen to license Roaster's VM along with its upcoming JIT (see "Future prospects," below), for inclusion in version 8 of MacOS.

Incidentally, my choice of the Fractal demo was not  a deliberate attempt to defeat the JIT. I chose this particular applet before Symantec released the JIT for Café. My reasons for choosing it were simply that it took a noticeably long time to run and that it had clear locations at which to insert timing code.

Note that Netscape's abysmal performance may be due to an inferior virtual machine implementation, or it may be due in part to the fact that Netscape's class loader, for security reasons, performs a verification step before running Java bytecodes, even if they are loaded from the local filesystem.

Stability

Those who experienced the first developer release of Roaster will be glad to find that this later release is much more stable. In DR2, Natural Intelligence has fixed virtually all of the crashing problems that plagued DR1. CodeWarrior is also quite stable.

Note that you'll need a lot of RAM if you want to run applets from within the Café IDE -- possibly more than 24 megabytes, depending on how loaded your system folder is. Running applets from within the IDE launches the AppletViewer, and between the two, they take up nearly 12 megabytes of RAM.

Although on the whole the environments are fairly stable, it's a good idea to keep in mind that these are still beta-quality IDEs, and you'd be wise to save your work often. None of the environments are completely immune from the occasional crash.

All of the environments, except for Metrowerks', exhibited stability problems when using the classes in the java.net package. To test these classes, I used a chat applet that I developed, as well as the more fully-featured Earthweb Chat applet (http://www.gamelan.com/ noframe/community.html). Kids, don't try this at home. Take my word for it, especially with Sun's JDK, running programs that call the java.net classes can crash your Mac hard -- with or without MacsBug -- unless you're using Metrowerks. (See "Completeness of implementation"," below.) This caveat is true not only of Java development environments, but of Java-enabled, beta versions of Netscape as well.

The failure of most of the environments to fully support the java.net classes is disappointing. One of the great strengths of Java -- the "language of the Internet" -- is the extent to which it simplifies the task of communicating via network sockets. The fact that implementors have had such difficulty just porting the network classes to the Mac is an indication of how much trickier it can be to write network code in C or C++.

Completeness of implementation

API

In their current releases, all of the tools do a fairly complete and faithful implementation of the application programming interface (API). Early releases of Roaster and the JDK had major difficulties with some of the abstract windowing toolkit (AWT) classes, but apparently these problems are gone. You have to look pretty hard to find API implementation bugs in these products. There are still bugs, but for the most part, they are minor ones.

The big exception to this, of course, is the java.net package. Natural Intelligence's release notes for Roaster DR2 concede that Roaster's implementation of java.net is not complete, but they claim that the package will work correctly if the client and the server are on the same machine. I tried a chat client/server pair that I had written, which works fine under Windows 95/NT, Solaris, and Linux; it did not work under Roaster's Applet Runner, even when the client and server were on the same machine.

Symantec's release notes claim that the java.net classes work in Café DR2. In my tests, they failed to establish a connection using the Socket and ServerSocket classes, and left the Mac in an unstable state with regard to network activity until it was rebooted.

Metrowerks wins the prize for the most complete implementation of the Java API. Marcus Jager at Metrowerks attributes the strength of its implementation to the fact that it was based on Metrowerks' PowerPlant class library, a solid, well-written framework that has been the basis for more than a few commercial-grade Mac applications. Sun was impressed enough with CodeWarrior's PowerPlant-based implementation that it chose Metrowerks as a development partner. Future versions of the Mac JDK will be the result of collaborative work between Metrowerks and Sun. Microsoft has also licensed Metrowerks' implementation of the JVM for inclusion in the Mac version of Internet Explorer 3.0.

Stand-alone applications

All of the tools claim the ability to create and run Java stand-alone applications as well as applets. In Roaster, to create a stand-alone application, you simply write a class with a main() method, and designate that class as the startup class of your project. Currently, however, you cannot pass more than one parameter to the main() method, limiting Roaster's capability to run stand-alone applications; there's a workaround, but that doesn't help you run stand-alone applications written by someone else, without editing their source code. Also, the only facility Roaster provides for running applications is to choose Run from the menu in the IDE. There is no way to create a double-clickable application, or one onto which you can drag-and-drop a file.

When you create a project in the Symantec project manager with Café, you are given the option to create either an applet or an application. If you specify "application," the project is created with a sample "HelloWorld.java" placeholder file with the familiar one-line main() method. You specify arguments to main via a text-entry box in one of the Project Options dialog boxes. As with Roaster, there is no way to create a double-clickable application using Café.

Sun's JDK contains an application called "Java Runner," which is an interpreter for Java stand-alone applications. If a compiled class file contains a main() method, you can drag and drop that class file over the Java Runner application in order to run it. If the class file requires command-line arguments in order to be run, a dialog will appear asking you to enter arguments. The JDK also contains a README file detailing how you can use the JDK, in combination with ResEdit and a Macintosh resource compiler (like Rez), in order to create double-clickable Java applications. To do this, you make a copy of the Java Runner application, and then add and edit a few of its resources so that it automatically runs your Java application. The process is a little complicated; it's not for the beginner. Still, the examples included with the Mac JDK do a decent enough job of showing how it's done.

CodeWarrior is the only one of the IDEs that provides a way to create double-clickable, drag-and-droppable Java applications. CodeWarrior supports four types of output for Java projects: a class folder, a "droplet," a zip file, and a "runable" [sic] zip file. Despite the misspelling of "runnable," the choice of the word is unfortunate, as it has absolutely nothing to do with the familiar interface java.lang.Runnable; instead it refers to the ability to run the application or applet by choosing Run from the Project menu in the IDE. Metrowerks deserves credit for CodeWarrior's flexibility in terms of project types, but the names are somewhat counter-intuitive, and do not map well to the choices you get when creating a new project. Sources at Metrowerks indicate that it is revising its approach to make it more intuitive. Incidentally, the fact that you cannot run regular .classfiles from inside the IDE is a nuisance. I imagine Metrowerks is working on fixing that one too.

Native methods

Only Sun's JDK currently provides full support for native methods, although as you might guess, the process is rather arcane -- even more so than on other platforms. Again, the steps are described in a README file and a set of examples that come with the JDK. Native methods are not currently supported for 680x0 Macs, only for the PowerPC. The reason is that the CFM (code fragment manager) extension, which provides support for shared library access, is only available in final form for the PowerPC at this time. Sun says that "support for a CFM-68k run time is being considered."

Metrowerks says that the current version of CodeWarrior's Java plug-in does not include complete support for native methods; however, the Metrowerks Java application includes a javah utility, which can be used in combination with the JDK to create Java applications that call native methods (PowerPC only). The implication seems to be that future updates of CodeWarrior will provide full support for native methods within the IDE.

68k support

68k and PowerPC support is provided by current versions of Roaster, the JDK, CodeWarrior, and -- with the release of DR2 -- Café. Café's JIT, however, is currently implemented only for the PowerPC.

Documentation

None of the products ships with printed documentation. Printed documentation is expensive, difficult to keep updated, and lacks the automatic search and hypertext facilities provided by electronic documentation. Still, electronic documentation is no substitute for a printed manual when it comes to bathroom, waiting room, or subway reading. Call me old-fashioned, but I still find it easier to flip through the pages of a printed manual than to point and click (and wait) my way through a hypertext document. If you have a small monitor, or less than 24 megabytes of RAM, hypertext documents may take up more screen real estate or memory resources than you can afford. Hypertext is excellent in combination with a printed manual, but not as a substitute.

Except for the JDK, which comes with SimpleText README files for documentation, all of the tools ship with documentation in Adobe Acrobat PDF format.

Clearly Roaster's documentation, like Roaster itself, is a promising work in progress. I found it particularly annoying that the documentation for DR2 lacks a bookmarked table of contents. One of the first things I do when I open an Adobe Acrobat file is to turn on the bookmarks on the left-hand side of the screen. I presume that Natural Intelligence will put the bookmarks back in before the final version of Roaster ships, but for now Roaster's documentation, though well-written and thorough, is not much fun to navigate. Although it does not set out to provide as complete an introduction to Java as the full books included in Café and Discover Programming, it does explain basic concepts of Java simply and concisely, in addition to serving as documentation for the IDE.

Roaster also includes a one-click online help feature, whereby you can highlight any method or class from the API where its name appears in your code, and at the click of a button on the toolbar, Roaster automatically opens Altura's QuickView (included with Roaster), with a specially-created version of the hyperlinked Java API documentation. QuickView is a document viewer (familiar to users of CodeWarrior) that allows searching and browsing, as well as the addition of user notes (somewhat like "stickies") at any place in the documentation.

Symantec's Café and Metrowerks' Discover Programming with Java both include excellent documentation. In addition, these two products each come with a complete book in PDF form: Introduction to Java Programming  and Learn Java on the Macintosh, respectively. Of the two, Metrowerks' Learn Java is more thorough as an introductory text, but bear in mind that it is aimed at those with little or no programming experience. Experienced C or C++ programmers learning Java as a second or third language might find the text a little too elementary.

Those who downloaded the original beta version of the JDK will be pleased to find that the README files that come with version 1.0.2 include much more thorough and Mac-specific information. These documentation files are about the most you can expect from a free product that is not itself an IDE.

Speaking of documentation, both Roaster and Café support javadoc-style documentation generation from doc-comments in Java source files. Generating this documentation and having it all appear in a sensible location is as simple as setting a preferred location in the preferences dialog and pulling down a menu item from the IDE. Of the two, Café currently offers more comprehensive support for various nuances of this feature than does Roaster. On the other hand, only Roaster will allow you to create all of the documentation for an entire project with a single menu command; Café makes you do it one source file at a time (although a fix for this is expected in the next version).

CodeWarrior can create this type of documentation as well, but it's not nearly as simple. To do this from CodeWarrior, you have to run the Metrowerks Java interpreter, and in the command window, type:

sun.tools.javadoc.Main /Full/Path/Name  .java

To quote Marcus Jager at Metrowerks, "Getting the output files to appear in a proper location is left as an exercise for the reader." Not very Mac-like, if you ask me.

Note that none of these Mac implementations of javadoc have made any attempt to deal with the "long filenames" problem. Since the HTML files output by javadoc are named automatically from fully-qualified class names (like java.lang.ArrayIndexOutOfBoundsException), they sometimes result in names that are longer than the 31-character limit on filenames under MacOS. As a result, these filenames are truncated by the system, and a Web browser following links to these files will not find them. The only workaround is to keep your class and package names short.

Technical support

Both Natural Intelligence and Metrowerks provide unlimited technical support via phone and email to registered developers for the duration of their subscription. Both companies, and NI in particular, have gone to great lengths to prove their commitment to providing top-quality technical support. NI's java-mac mailing list has been of invaluable help to Mac Java developers, regardless of their choice of development environment. I called both Metrowerks' and Natural Intelligence's technical support departments, and found the staff to be knowledgeable, friendly, and extremely willing to provide honest, in-depth help. In both cases, the person who answered the phone was able to answer my question without putting me on hold.

Symantec provides unlimited technical support for Café for 90 days, starting from your first call. After that, if you still want technical support, there are several payment options. I tried calling Symantec's technical support department, but after five minutes of waiting on hold, I gave up. To be fair, I was offered an opportunity to leave a message, but I chose not to. On a later call, I held for only two minutes and spoke to a representative who put me on hold again while he asked someone else for the answer to my question ("How do you turn on the JIT in the AppletViewer?"). While on hold, I found the answer in the Adobe Acrobat documentation that comes with Café. To his credit, he returned with the correct answer. (In case you're wondering, the control to turn on and off the JIT is tucked away in a hierarchical Java Runtime submenu of the Apple menu).

Sun does not provide technical support for the JDK. If you can't figure it out from the documentation, subscribe to java-mac@natural.com and post a question. Some kind soul is likely to help you.

Future prospects

Because all of these products are in varying stages of their gestation periods, they all promise new features in the not-too-distant future.

Natural Intelligence has made it known that it is working on a JIT compiler; NI expects it to be available some time this summer. In the meantime, NI has put work on Roaster's native Java compiler on the back burner. This seems reasonable, partially because of its fast VM, but also because once its JIT is available, the performance gap between Java bytecode and native code is likely to narrow significantly, effectively obviating the need for a native compiler.

Source-level debugging is a feature most of the products advertise, but fully-working implementation is in the future. Metrowerks has come the closest, and just needs a few finishing touches in terms of being able to debug from within the IDE. Natural Intelligence is not far behind in Roaster DR2. Roaster DR2.1 is expected to have a better debugger, with the unique feature that it will allow you to selectively load and unload class files, allowing you to test your changes without quitting the debugger. Symantec has included a pre-release debugger in Café DR2. In the near future, all three of these debuggers will reach maturity and become useful tools.

In terms of updates, you can expect that Roaster and Café will each be coming out with one more developer release (versions DR2.1 and DR3, respectively) before a final product is available. Metrowerks has released a minor update to Discover Programming with Java, bringing it up to the level of the Java tools included with CodeWarrior 9. Other minor updates may come this summer, but don't expect any real new features until CodeWarrior 10 comes out in September. Metrowerks has not really owned up to the fact that Discover Programming with Java is a work in progress (see "Truth in advertising," below).

On the visual GUI development front, Symantec is expected to release Visual Café for the Mac soon, but it is likely that this product will carry an additional price tag. Natural Intelligence plans visual GUI tools for inclusion in the next update to Roaster. Metrowerks has plans to include in CodeWarrior 10 a tool for Java GUI development, to be based on Constructor, its visual tool for constructing Macintosh application GUIs.

Also in the forecast: both Metrowerks and Natural Intelligence plan Windows-based versions of their development tools, to be released by the end of this year.

Natural Intelligence's recently announced partnerships with Quarterdeck (makers of the WebStar HTTP server for the Mac) and EveryWare (makers of Tango and Buter SQL) give Roaster an early lead in terms of database connectivity and server-side Java applets. Early versions of database support classes are provided with Roaster DR2. When Sun's JDBC API (Java Database Connectivity -- see JavaWorld, June 1996) is finalized, Roaster will have a head start in this arena.

Natural Intelligence is also working on a product called Roaster Professional, expected before the end of 1996, tailored specifically for Java application development. One unique feature of this development environment is that it will enable programmers to write truly stand-alone, native PowerPC, 68K, and Windows 95/NT applications in Java. According to Christopher Evans of Natural Intelligence, even the Macintosh Toolbox will be accessible through a class provided in Roaster Pro. This runs somewhat against the grain of the cross-platform Java ideal, but the Java language has many features that make it attractive even for development on a single platform.

In the past two months, Sun has revealed plans for extending the Java API. Natural Intelligence, Metrowerks, and Symantec will surely be integrating support for these new extensions in future updates of their Macintosh products, but for now, they've got their hands full just implementing the core API.

Truth in advertising: Who can you trust?

In a chilling scene from the movie Gorky Park, an eccentric professor warns the idealistic Arkady Renko (played by William Hurt) that people like Renko are in danger of falling into "a chasm... between what is said and what is done." Consumers in the software industry are quite familiar with this chasm, and it's one of the reasons we carefully read reviews before buying products.

Symantec and Metrowerks are very quiet about the "developer release" status of their Java IDEs. The outer packages say nothing to imply that these products are incomplete. Even if you visit their Web sites or read their press releases, you might still be led to believe that these are finished, final-release products that fully implement the Java language and API, and are -- within reason -- free of bugs. It's not until you've already paid your money and opened the box that you discover that what you have actually bought is a "developer release," and you are participating in what amounts to a paid beta program.

In my opinion, Metrowerks is guilty on more than one count of having misleading advertising -- the awards pictured on the box for Discover Programming with Java were, in fact, won by CodeWarrior Gold, not by Metrowerks' Java tools. Discover Java does not come with major updates. This is unacceptable for a product that is as clearly beta-quality as this one. Even given that Metrowerks' Java implementation is more nearly complete than any of the others, the company should not be let off the hook for this.

Symantec, too, should be ashamed of itself. The words "developer release" do not appear in any of its press on the product; the only place I can find them is on the release notes included with Café itself. The press releases for DR1 actually went so far as to call it "Release 1;" you had to open the package and mount the CD-ROM to find out that it was actually DR1. It seems Symantec has gone to great pains to hide the beta-quality status of the product from prospective users. Exceptions to this are the Café debugger and Café Studio, which are acknowledged as being pre-release quality.

Either Symantec is deliberately marketing Café as a final release -- despite the fact that the product is still of beta quality -- or it is not doing a very good job of educating its sales staff. At the JavaOne conference in San Francisco at the end of May, I explicitly asked a Symantec representative with regard to DR2: "Is this a developer release or a final release?" The reply: "This is a full-fledged, final release of the product." On May 20, Symantec announced that version DR2 of Café was available for download from its Web site. Users who went to check it out were disappointed to find that it was not there yet. Three weeks later, on June 10, Café DR2 was finally made available for download.

Natural Intelligence released a statement in mid-April announcing that Roaster Release 1 was imminent. Shortly afterward, NI amended its announcement, saying that the upcoming release was to be called Developer Release 2, and that registered developers would still be entitled to two major releases after this one.

Natural Intelligence's official stance on this last-minute change is that certain components of the product were not yet up to its standards. An unofficial source inside NI tells me that Symantec's announcement of Café for Macintosh scared NI into announcing a final release, but when NI saw that Café was in fact still a developer release, the company became less concerned. It is also true that some owners of Roaster DR1 complained loudly when it looked like NI was going to try to pass off a product with beta-quality features as a final release. Regardless of its reasons, it can at least be said that NI eventually did the right thing by retracting its initial announcement. More than any of the other vendors, Natural Intelligence has been very up-front about the in-progress status of Roaster, maintaining a public "Roaster DR2 Known Issues & Fixes" page, which is updated each time a new version becomes available.

Perhaps I'm being too idealistic, but I believe that if a product is not a final release, this detail should be clearly and unambiguously stated in any public advertisement of the product.

Conclusions

There are plenty of good things to say about each of these products. If you want to get started on Java for the smallest possible price tag, you don't need to buy an IDE; you can download the JDK for free, and use any shareware or freeware text editor to enter your code. On the other hand, if you want the convenience and features of an integrated development environment, you have choices.

Of the three IDEs, I find Roaster's environment to be most intuitive and its features best suited to the Java language. When I want to write Java code, I turn to Roaster first. Roaster is a Java-only environment. In terms of cost-effectiveness, this is a drawback in that it makes Roaster a rather expensive one-trick pony. In terms of user-interface, however, Roaster has an advantage over the other environments in that it is free of distracting features relevant only to other languages.

Natural Intelligence could establish Roaster as the clear choice for Macintosh Java development if it lowered its price to a more competitive level. At 99, Roaster is three times as expensive as either of its competitors. For only 00 more than the price of Roaster, you can get CodeWarrior Gold, which provides a complete Mac-hosted development environment for Pascal, C, C++ and Java. True, Roaster has impressive user-interface features, but it's a question of how much you're willing to pay for them.

Important! See Update.

Café is a fine product in many ways. Of the three environments, it's the only one that includes built-in source code version control, a very important feature, particularly if you're working on a development team. Café is currently the only product to include a JIT for the Macintosh. It's also the only Mac development environment with any sort of visual GUI-building tool for Java -- although that tool is of limited utility at best. Café's user interface for Java development, though not quite as well-developed as Roaster's, is easily superior to that of CodeWarrior.

I'd like to say that Metrowerks has brought to its Java tools the same standards of excellence that have made CodeWarrior a force to be reckoned with in the Mac software development arena, but at least in terms of user interface, this is simply not the case. Metrowerks' engineers have diligently provided CodeWarrior with the most complete and faithful implementation of the Java language available on the Mac platform but apparently at the expense of its user interface. On its technical strengths alone, CodeWarrior might be the tool of choice for the seasoned developer (especially those with Unix experience), but for the Mac aficionado, even Discover Programming with Java is likely to be a frustrating experience.

We're not completely out of the woods yet. None of these products is yet 100 percent mature. Along with its features, each carries its own assortment of bugs and flaws, some more serious than others. As a result, we find ourselves in an odd twilight zone: although the days of waiting for Java to come to the Mac are very nearly over, all of the existing tools have a way to go before they fulfill the promise of a complete Java development environment for the Mac. Nonetheless, with four tools to choose from, it is finally possible to approach serious Java development on the Mac platform. Regardless of which tool you choose, it's good to know you have choices. The competition is pretty intense, with each vendor carefully watching and responding to the activities of the others. Ultimately it is you, the consumer, who benefits from this competition. As long as the IDE vendors have someone to outdo, they will have to keep outdoing themselves.

Dave Makower is a Web consultant and Java developer for Pencom Web Works, a business unit of Pencom Systems, Inc., headquartered in New York City. He is a co-author of Java Programming Basics (Henry Holt/MIS:Press, 1996), and a technical editor for the soon-to-be-released Java in Plain English (Henry Holt/MIS:Press, 1996). Dave's current projects include exploring Java's potential for database access, and using Java to extend the W3C's new Jigsaw Web server. When not hacking or writing articles late into the night, Dave can be heard playing keyboards in NYC with both Still Trust and The Evan Kremin Band.

Learn more about this topic