Cover Story (sidebar) / January 1997

The Bitter Taste of Java

Tom R. Halfhill

In the Java world, your code might be bug-free but still not work properly. This is especially true when you test it with a different run-time environment — even another run-time environment on the same computer.

That's because Sun and JavaSoft haven't ironed out all the wrinkles in Java, particularly in the Abstract Windowing Toolkit (AWT) classes that let Java programs use native GUI features. Also, the vendors who license a run-time environment from Sun are primarily responsible for adapting it to their products and to native platforms, and some vendors do a better job of this than others. JavaSoft says testing improvements will mean fewer variations in the future.

In the meantime, Java pioneers need patience. To get a taste of what early developers face, I wrote a Java version of a program I've already written in three other languages. My project was a data-entry applet for friends who enter my annual Academy Awards contest. Because the applet also provides data verification and back-end processing, it needs more than Hypertext Markup Language (HTML). I've written a Windows version with Borland Delphi (Pascal) and two Mac versions with HyperCard and FutureBASIC.

I developed my Java applet on both a Mac and a Windows PC. All the Java tools I tried — including versions of Symantec CafĂ©, Microsoft Visual J++, and Metrowerks CodeWarrior — caused problems. They frequently crashed, and their applet viewers either ran my program poorly or wouldn't run it at all. In fact, I had the least trouble when I abandoned those tools, wrote my code with ordinary text editors, compiled it with Sun's free command-line compiler, and tested it with Web browsers.

The accompanying screens show how various run-time environments interpret the same code in different ways. My class files were completely portable — Java lives up to that promise — but the results weren't always what I expected. Some run-time environments completely ignored methods and events in my code, while the identical code ran fine elsewhere.

If you're not comfortable with these kinds of problems, wait for better tools and run-time environments. From what I've seen, things will be a lot more stable in a few months.

Screen photos of
                  Java bugs.
One App Three Ways

Copyright 1994-1998 BYTE

Return to Tom's BYTE index page