The Sexiest Computer on Earth!

Macintosh on Ulitzer

Subscribe to Macintosh on Ulitzer: eMailAlertsEmail Alerts newslettersWeekly Newsletters
Get Macintosh on Ulitzer: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Mac Authors: Carmen Gonzalez, Shelly Palmer, Aria Blog, PR.com Newswire, Kevin Benedict

Related Topics: Java Developer Magazine, Macintosh Magazine

Java Developer : Article

Java and The Mac

Java and The Mac

When Java Development tools initially appeared on the market, Mac programmers were some of the last people to have tools available to them. While Sun chose to release the JDK for most popular platforms, it waited quite a while before releasing the MacJDK. A variety of third party developers began to release Java development tools, but they too have decided to wait before releasing tools for the Mac programmer. Fortunately, there are options open to the Mac programmer now, but these options are nowhere near as vast as those options open for users of Windows95 or UNIX platforms. General resources related to MacJava are also few and far between. Before I send you running from your Mac, it should be stated that the situation is no longer as bleak as it once was. There are currently development tools available from many companies, and more have been announced; there is also a large amount of published information available. You should keep in mind however, that while it is important to have platform specific resources, Java is extremely portable, and almost all information resources are helpful.

There are three available compilers for the Mac. These are Sun's JDK, Symantec's Caffeine, and Natural Intelligence's Roaster. The decision to include Caffeine in that list was actually debated over. While it does allow a programmer to develop in Java, it is not really a compiler. Rather, it is a GUI front-end for Sun's JDK.

Sun's JDK is comprised of two components: a Java compiler, and also an applet runner. It is not an Integrated Development Environment (IDE), and requires the use of a text editor like BBEdit, or SimpleText to create source code. BBEdit is an incredible text editor. While it does not support syntax coloring, it does offer automatic indentation and code balancing. Caffeine is a free upgrade to owners of Symantec C++, and adds some nice features to the JDK. These include a project manager, a scripted interface to the JDK, and Java specific syntax coloring.

The JDK is a nice product, and the Caffeine/JDK team is even nicer. Currently the JDK is the only Java compiler to offer full networking and audio support. It also will run on 68k machines, which Roaster will not. While Natural Intelligence will offer all of these features in the next version of its product, at the time that this article is being written there is no support for these features.The JDK does have its problems however, and since it forms a backend to Caffeine, both products share these problems. Starting out, the most obvious problem is related to speed, or rather complete lack of speed. Compiling with the JDK (even for small projects) is a long ordeal. Developing with the JDK often takes so long that before byte code is ready, one not only has time to brew Java, but also to finish a pot or two. To demonstrate this problem with speed, I wrote a simple applet which prints a message to the screen. The applet is only twenty-four lines long, and imports java.awt.Graphics, java.awt.Font and java.awt.Color. Time to generate byte-code with Roaster running on a PowerMac 6100/66 with 16 Megs of RAM (plus RAM doubler), and system 7.5.3 is 9.853 seconds, while to compile this same source with the JDK I waited 12.500 seconds. This time difference, while relatively small, grows exponentially as the size of applets grow. Note that times were based on the average of twenty human timings.

Without the addition of Caffeine, one is also forced to suffer from the lack of a real interface. In addition to allowing for a more pleasant interface, a GUI brings tools like a project manager, which is invaluable when working on large projects. Natural Intelligence has provided an excellent project manager in Roaster. The tool supports full drag and drop, and also presents a pop-up-menu with all file methods next to its entry in the window. One advantage the JDK has over other tools is its price. It's free!

What is really helpful when working with the JDK is its ability to open source code into a configurable text-editor. Not only will it open your source, but it will drop you on an offending line of code. This is really helpful, especially when using editors which don't use line numbers. While it is nice that an editor can be configured to run with the JDK, development is hindered by the fact that there are no text editors which support syntax coloring. Rumor has it that the next version of BBEdit will offer this ability.

While Symantec chose to develop a GUI front-end to the JDK, Natural Intelligence, on the other hand, chose a different path. The application which they put out is totally their own. The application incorporates two Java compilers with a suite of development tools into a full GUI. The reason for two compilers is that in addition to bundling a speedier version of Sun's javac compiler (the compiler which ships with the JDK) they also wrote their own compiler. Both are PowerMac native, but as of DR1.1 only the javac compiler is recommended. Natural Intelligence classifies their compiler as "icky", and while I am not too sure that I would choose this word, I would definitely agree. It often gives odd errors, or will completely crash when attempting to compile an applet. Their version of the javac compiler is not perfect either; it is definitely much faster than Sun's version, but is less descriptive when reporting errors in one's source. There are trade-offs to using Natural Intelligence's compiler, but I rarely find that it is worth it to give up speed for more verbose error messages.

Roaster's text editor, shown in Figure 1, is based on Natural Intelligence's QuickCodePro. This version of their already popular text editor is an excellent environment to develop in. It supports a full suite of utilities including various search functions, a balance checker, multiple clipboards, and custom macro support. There also was much thought put into human-computer interface, as all functions are accessible via fully customizable tool bars, and keyboard shortcuts.

I find that when I am unable to find an error, Roaster and the JDK, in combination with each other, provide for a healthy relationship. I usually write all of my code in Roaster. If I have troubles debugging the code, I run it through Sun's compiler. As far as debugging is concerned, Roaster does incorporate a source-level debugger. This is somewhat helpful, but does mean that you must deal with interpreting byte-codes. It is still nice though, to be able to step through an applet while it is running.

Of all the current options available to the Mac programmer, Roaster does look to be the most promising. DR2.0 will be packed with all the features which 1.1 is missing, and it will definitely become an excellent product. Natural Intelligence reports that they were able to speed the product up even more, making Roaster the speediest Java compiler available for the Mac. Soon after DR2.0 is released, Natural Intelligence will be releasing a different product titled RoasterPro. Among other enhancements, this product will allow programmers to compile Java into code native to a multitude of platforms. Also look for a Windows version of Roaster in the Fall.

More Stories By Luke Cassady-Dorion

Luke Cassady-Dorion is currently finishing his degree in computer science at Drexel University in Philadelphia, PA. Additionally he heads up Java Development for Odyssey Systems Corporation in Manayunk, PA.

Comments (0)

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.