Chapter 4

Java Development Environments


CONTENTS


develop \di-'vel-ep\ v: to make active or promote the growth of

Introduction

When the Java programming language was introduced in 1995, the only development tool available was the Java Developer's Kit (JDK) from Sun. This set of command-line tools-which is described in appendix B-makes it possible to write, compile, and debug Java programs. However, the JDK is a far cry from the software used to write programs in languages such as Visual Basic and Borland C++. These languages make good use of integrated development environments.

An integrated development environment is software that combines several development tools into a single, cohesive package. The assortment usually includes a source code editor, compiler, debugger, and other utilities. These tools work together through the development process and most use windows, drag-and-drop, and other graphical elements. The goal is to make software design faster, more efficient, and easier to debug.

Many IDEs make use of rapid application development (RAD) methods in their approach. Rapid application development is a broad strategy to use tools such as an interface designer and prototyping which can speed up the design process. For most of the Java programming environments that have been released, the RAD tools in evidence are graphical user interface builders. Some of these have a direct connection from the interface design tool to the source code so that you can design a component such as a button and go directly to the event-handling code to make something happen when the button is clicked.

As further evidence of Java's enormous popularity, the number of Java development environments has gone from one to more than 40 in a matter of months. Many of these programs are in early beta release or are unreleased in any form, but several have reached the market.

This chapter focuses on some of the environments you are most likely to have heard about and seen available at retail outlets. As you evaluate whether each of these fits your own programming needs, you are better suited to choose from among the on-rushing march of IDEs that have become available.

Note
A frequently updated list of Java IDEs, with reviews and notes regarding these tools, is presented at the following URL:
http://www.cybercom.net/~frog/javaide.html

The following development environments are described:

You learn about the features of each environment, the systems they can run on, and some factors to consider when choosing which to use. Other Java development environments such as Microsoft Visual J++ are described briefly in order to provide a full picture of the choices available to you.

Selecting an IDE

When you are evaluating an integrated development environment for any language, you need to ask yourself some questions about what you need to have on hand when you're ready to develop a program. This holds true for any language and any environment but there are specific issues that relate to Java programming because of its unique features such as portability.

You need to ask yourself the following:

GUI Development Tools

The popularity of windowing systems is well-established and users have begun to shy away from software that does not make use of these features. Though some of us grizzled veterans have a love of the old ways-DOS utilities, the command prompt, batch processing, '70s dance funk-most users today expect their software to have features such as mouse control, point-and-click, and resizeable program windows.

This makes graphical user interface design an important element of most Java programming, so it is important to select an IDE that is strong in this area.

Most Java IDEs are distinguishing themselves from each other by their approach to interface design and the functionality that is possible from within the interface development tool. Also, there is software such as RogueWave's JFactory that is primarily an interface builder rather than an entire IDE.

Note
Jfactory currently is available in beta form. You can find out more information on the product and download a free beta release of the software from the RogueWave Web site at the following URL:
http://www.roguewave.com/products/jfactory/jfactory.html

Most Java interface builders work in largely the same way-like a painting program. You start with a blank form and a palette of user interface components. These components are usually abstract windowing toolkit (awt) objects, and the interface builder generates awt code that can be modified by a programmer who is fluent in dealing with the toolkit. Some IDEs such as SunSoft Java WorkShop supersede the awt by introducing a layer between the awt and the programmer's source code. The goal of a layer such as this is to make it easier to deal with windowing and interface issues. The IDE handles things behind the scenes so that the programmer can concentrate on larger issues.

For some programmers, especially those who spent a lot of time learning the intricacies of the awt, this might not be an attractive feature. Others might be more interested in the power that is offered by these interface builders or might be ready to leave the complexity of the awt behind.

One of the nicest features of these builders is the ability to generate event-handling code at the same time that a user interface component is created. Anyone who has used Visual Basic is familiar with this. You plunk down a text field where you want it on a dialog box, double-click the text field, and then begin entering the source code to control how it operates.

Portability of Code

One of the features to watch for when choosing an IDE is whether it produces code that is fully compatible with the Java class library. Several of the development environments such as Café and Java WorkShop come with their own versions of the JDK instead of being used with an existing implementation of the JDK.

This usually does not matter because one of the goals of any Java IDE is to take advantage of the language's ability to be portable across any platform. Many development environments such as SourceCraft NetCraft work entirely within the JDK, and they create software that does not enhance those features with proprietary extensions.

Others, such as Microsoft Visual J++, add features that require new classes. J++, formerly known under the code name Jakarta, has extensions to the Java language that are specific to the Windows operating system. For an applet or application designed with Visual J++ to be fully portable, it must not make use of these extensions. Because this IDE is not yet available, it remains to be seen whether the advantage of extended features makes up for the significant disadvantage of platform specificity. This issue is hotly debated within the community of Java developers because many believe that the continued growth of the language depends on its ability to stay cohesive and fully cross-platform.

An interesting side issue to the portability question is that most Java development environments are not cross-platform themselves, even when the IDE is touted as being a Java program. All of the major IDEs that have been introduced to date are offered for specific platforms, primarily because of the use of native code.

IDE Experience

One element of IDE use that sometimes gets lost in the shuffle is the skill level required to use them. If the idea of an IDE is to improve your programming, this isn't going to happen if you can't figure out the IDE! An integrated development environment is a complex type of software. It often makes use of a multiple document interface where you can have several windows open at once and a dizzying array of options.

For experienced programmers, this functionality is a great boon. You want to have as much power at your control as possible. A new programmer easily can get lost in the IDEs that are available-especially if the programmer is still learning the language. When you are busy clearing out space in your brain for a new programming language, you shouldn't have to find room for an IDE at the same time.

Several of the IDEs available for Java are more suited for the code warrior-the multilingual veteran who can throw around jargon like OOP, MUMPS, and male-female connector with the greatest of ease. However, a few of the development environments are more suited for the newcomer because their interface is more approachable and less complex.

The best example of this is Java WorkShop from SunSoft because it uses the familiar web browser interface. A person who is coming to Java from a limited programming background, such as an HTML developer looking to upgrade skills, can find this kind of IDE more suited to his or her taste.

There is a trade-off for this ease of use, of course. An environment like Java WorkShop might require more steps to get a task done, because the functions are not immediately available, or might not offer some of the functionality of a more complex IDE.

Multiple Language Development

Another factor regarding the use of an IDE for some programmers is its use with other languages. Several of these environments, including MetroWerks CodeWarrior and Borland 5.0 C++ IDE with Java Enhancements, are designed to handle more than one language, or are fully equivalent to the company's other development tools.

If the IDE is a complex one, as these are, you learn how to use it and don't have to learn another when you shift gears and program in a non-Java language.

Also, if you write native methods for use in your Java programs, you can use some multi-language IDEs to write that code. The Borland 5.0 Java environment comes with a C and C++ compiler, so native methods can be written alongside Java methods in an integrated manner.

The Bottom Line

The goal of an IDE is to make you a better programmer. As Java developer Chuck McManis wrote in his August 1996 JavaWorld column, "I rate the IDEs by my ability to get productive work done while using them."

As you go over the details of the software that are discussed in the following sections, you get a clearer picture of how each environment can help you. Given the number of IDEs that already are available for Java, you should be able to match one with your skill level, programming tasks, and personal taste.

If not, there's always the JDK. It can be matched with word processors, custom interface builders, and other single-feature design tools to create a personalized IDE.

Caution
If you are downloading tryout or beta copies of several IDEs, as has been done in the course of preparing this material, be advised that these rival products might not co-exist peacefully. Many Java development tools make use of environment variables such as CLASSPATH and JAVAHOME, and they are not happy if another software tool has claimed these variables for its own purposes. As an example, Café and Java WorkShop are the Prince Charles and Lady Diana of software-they should be kept apart for the benefit of everyone involved. If possible, de-install one IDE before installing the next one on your system and make sure your bootup files are cleaned out as well. If you need more than one IDE active on your system, you can establish multiple configuration files to be executed when one of the environments is used.

Symantec Café

Symantec Café, released in March, is the first development environment that became widely available for Java programming after the JDK. Symantec calls it an integrated development and debugging environment, or IDDE, but the added D doesn't make it different than most IDEs. They usually include a debugger, too.

Café is based on Symantec's C++ environment, but Café is a stand-alone product that does not require that C++ platform in order to run.

Figure 4.1 shows an example of Café at work.

Figure 4.1 : A screen capture of Symantec Cafe.

System Requirements

Symantec has released versions of Café for the Microsoft Windows 95, Windows NT 3.5x, and Macintosh systems.

For Microsoft users, an Intel 386 processor and 8M memory are required, but a 486 or better and 16MB memory are recommended. A VGA monitor is needed, but Symantec recommends that an SVGA monitor be used if available. The software, and all of its sample files and help files require 60MB of disk space and a CD-ROM drive.

For Macintosh owners, a Power Macintosh, 68030, or 68040 Macintosh is required, and 16M memory is recommended. The full installation of the software requires 30M of disk space.

Café incorporates the JDK into its release with a full implementation of the Java class libraries and source code samples. You do not need to have the JDK before installing Café. In fact, it is prudent to de-install the JDK before implementing Café to avoid system conflicts between the two.

Overview

Café is a sophisticated IDE that offers an excellent source editor with color highlighting of syntax, an editor for class and hierarchy modification, a Studio tool for interface design, and numerous example applets.

Because it has been on the marketplace for a long time relative to its competitors, Café has the advantage of being more robust than some other IDEs. It also has been documented more fully in books such as Teach Yourself Java in Café in 21 Days, available now from Sams.net Publishing.

To aid in the design of a class hierarchy, Café has a class editor for navigating through classes and editing class methods and a hierarchy editor for viewing and modifying Java class relationships. Changes in the source code that affect the class hierarchy can be seen as the program is being written, instead of requiring that it be compiled before changes are reflected in the hierarchy. You also can change the source code from within the class editor-clicking the function or method within a class brings up its source code in a window that can be used to edit the code.

With appexpress, the process of creating a skeleton Java program is speeded up. This and several other Express Agents-Café's term for wizards-make it easier to begin projects and new programs.

In the source editor, Java syntax is highlighted, making it easier to spot typos and other errors immediately. The editor can be customized to behave like several popular programmers' editors such as Brief, Emacs, and Epsilon. It also uses standard Windows cut, copy, and paste commands.

With Café Studio, designing a graphical user interface for your Java programs can be done in a visual, drag-and-drop manner. Studio enables programmers to develop the dialog boxes and other visual elements visually, and it creates event handlers for these components automatically. There's also a menu editor with an active window where the menu can be tested. These resources are saved in separate .rc files that can be edited later just as source files are edited, and the .rc format is compatible with other design tools that generate .rc files.

One interesting aspect of Café Studio is the ability to design a form and dictate exactly how it looks. With the JDK and its abstract windowing toolkit, graphical user interface designers had to allow their work to be changed depending on the platform the applet or application was being run on. This is similar to the way that HTML can be modified to fit the large number of platforms that can be used on the World Wide Web, and it's an approach well-suited to cross-platform design.

With Café Studio, programmers can choose to use one of these variable layout managers or to dictate the position and size of all interface elements.

When you're ready to compile a program, Café provides the option to use Sun's JDK compiler or the Café compiler, which operates more quickly than the current JDK version.

The Café debugger provides several different ways to temporarily halt the execution of code, including a quick-breakpoint feature for a one-time run that stops at a specific line. The debugger also enables a large amount of control over threads in multi-threaded programs. During debugging, a watch view can be used to monitor the contents of variables.

The environment of Symantec Café is highly customizable; all toolbars and palettes can be resized and placed where you want them onscreen. Several windows can be open at the same time, making it possible to view the object hierarchy while entering source code and using the form editor, for instance.

There are 54 example Java programs included with Windows versions of Café and more than 90 with the Macintosh version. Many of these are duplicates of the sample applets that Sun offers with the JDK or on its web site at http://java.sun.com.

Pricing and Additional Information

Pricing is subject to change, of course, but the most recent retail price for Café quoted on the company's web site is $299.95 for Windows users. An introductory price of $99.95 was being offered to Macintosh owners for 90 days, which was to be followed by a $299.95 price. It can be purchased on Symantec's web site in addition to retail and mail-order outlets.

Some folks might not have to buy Café at all-customers who bought Symantec C++ from December 1, 1995, to March 1, 1996, are entitled to a free upgrade to Café.

The home page for Symantec Café is the following URL:

http://cafe.symantec.com/

The customer service number for the company is (800) 441-7234, and its e-mail address for Java-related comments and questions is [email protected].

SunSoft Java WorkShop

SunSoft Java WorkShop, the development tool offered by the language's home team, is scheduled for fall release and might be on the market as you read this.

The IDE is written almost entirely in Java, according to its designers, and its development has been used to help improve the Java language. The mindset at Sun is that committing to such a large-scale undertaking in the company's own language gives them insight into the issues that other developers are facing, and reveals any kinks in Java that still need to be straightened out.

However, that doesn't benefit the developer looking for a tool to write software. Java WorkShop is evaluated here on the basis of its applicability to this task.

Figure 4.2 shows an example of Java WorkShop in use.

Figure 4.2 : A screen capture of Java WorkShop.

System Requirements

Versions of Java WorkShop are available for the following systems: Microsoft Windows 95, Windows NT 3.5.1, SPARC Solaris (2.4 or later), and Intel x86 Solaris systems.

Microsoft Windows 95 and NT systems must be running a 90-megahertz Pentium or better with 16M of memory and 45M of hard disk space. Solaris systems must have 32M of memory, 45M of disk space, and an OSF/Motif 1.2.3-compliant windowing system. The recommended display resolution to use with Java WorkShop is 800 by 600 pixels.

Java WorkShop comes with its own modified version of the JDK, so it cannot be used in conjunction with an existing installation of the kit. Like Café, Java WorkShop needs to have any existing JDK copies deinstalled before WorkShop can be installed and run correctly.

Overview

Java WorkShop, one of the most approachable IDEs for a novice programmer, uses a web interface to offer the following features: a source editor, class browser, debugger, project management system, and Visual Java, a tool for the visual design of a graphical interface and an easier means to create windowing software.

Although still in beta release as of this writing, Java WorkShop has been available long enough to assess what kind of functionality it offers when the product hits the market. The most striking difference between it and other IDEs is the interface. Java WorkShop looks more like a web browser than a programming development environment. It is a web browser, in fact-users of Sun's HotJava browser will recognize elements from that software in the design of WorkShop and you can view any web page while in Java WorkShop.

Java WorkShop's browser interface is easier to use for programmers who are unfamiliar with IDEs and similar software and frustrating to some of those who are comfortable with these tools.

WorkShop has a source browser for viewing a class hierarchy, public methods, and variables. This creates HTML pages in the same format as HTML documentation generated by the JDK's javadoc utility.

The WorkShop source editor is still in an early stage of development and it lacks some of the cut-and-paste functionality of other more established editors. It works in conjunction with WorkShop's debugger-compile errors create links directly into the source editor for fixing and breakpoints can be used. The WorkShop debugger provides breakpoints and other methods of debugging.

The Visual Java feature provides a way to graphically design an interface, much like Café Studio. Visual Java enables programmers to develop the dialog boxes and other visual elements and it automatically creates event handlers for these components. There's also a menu editor and resources are saved in separate .gui files that can be edited later just as source files are edited.

Java WorkShop in its current release requires the use of run-time classes that make Visual Java work but developers have said that this will not be the case when the software hits the market.

The environment is not customizable in the manner of a product such as Café, but the web interface makes it easy to integrate other tools and programs into WorkShop. The program is a collection of web pages with Java programs embedded in them and around them. The user can go to a different page from within Java WorkShop as easily as a URL is entered in a web browser. This makes it possible for a user to create original pages of Java development tools that can be linked to WorkShop pages. This might be unusual for someone accustomed to a development environment that is written as a cohesive, single executable file that can't be changed, as most are. However, it suits the spirit of Java-independent programs linked together by HTML pages, which can be modified as individual elements without affecting the other parts of the whole.

Pricing and Additional Information

When it is released, SunSoft Java WorkShop is expected to retail for $295. While it is still in beta release, the software can be downloaded freely for evaluation. For more details, and the opportunity to download a beta release, visit the following URL:

http://www.sun.com/sunsoft/Developer-products/java/index.html

The customer service number to use for the company is (800) 786-7638 (SUN-SOFT) in the United States, or (512) 434-1511 elsewhere; and its e-mail address for comments and questions is [email protected].

SourceCraft NetCraft

SourceCraft, the developer of the ObjectCraft development environment, is making its NetCraft Java IDE available as freeware. For those unfamiliar with the term, freeware is software that is available for no cost as long as you comply with the developer's terms and conditions for the use.

This makes NetCraft attractive if cost is a criterium, obviously, but the IDE still has to be well-designed or you pay in terms of lost time and efficiency.

Figure 4.3 shows a look at the NetCraft environment.

Figure 4.3 : A screen capture of NetCraft.

System Requirements

Versions of NetCraft are available for Microsoft Windows 95 and Windows NT 3.5.1 systems running a 486 or better with 8M of memory. NetCraft comes bundled with the current version of the JDK, and SourceCraft also makes it available for download without the JDK if you already have it installed.

Overview

SourceCraft NetCraft is somewhat less ambitious in its approach than other IDEs because it has a smaller set of features that are available. However, it is a fully featured replacement for the JDK, and it creates Java programs that are compatible across all Java implementations. It has an editor, a class inspector, a user interface designer, and a compiler.

NetCraft is an IDE that can be used for any type of Java applet or application. In its approach to the software, SourceCraft focuses on Java's applicability in Intranet environments.

The Package Inspector, part of NetCraft's system for organizing projects, includes a way to browse the methods used in a class. There also is a Class Inspector for looking at the following aspects of a class: its position in the hierarchy, its methods, and its variables. When you are looking at a method with this tool, you can view the source code of the method and how it is used in a program.

NetCraft, like Café and Java WorkShop, includes a way to visually develop a graphical user interface. The NetCraft UI Builder generates Java code that uses the Abstract Windowing Toolkit as its raw material, so the code does not rely on any new classes introduced with the development environment. When you create an interface component, NetCraft generates source code for that component, with a TODO comment line where the event-handling code for that component is placed. It's a simpler approach than some of the alternatives and a programmer comfortable with the awt should be comfortable with this approach.

The source editor uses Windows cut-and-paste commands and is similar to other small word processors that you probably are familiar with.

The NetCraft UI builder is not much more difficult to use than a word processor. Although the components in the release available at this writing have the odd habit of moving around a little when clicked, a nice feature of the builder is the ability to set the specific coordinates, height, and width of a component by entering numbers into text fields. This makes it easy to bring wandering components inline with each other.

The environment is simpler to use and master than other IDEs. However, this might be a problem in the development of sophisticated programs with numerous windows and interactions because some of the tools to manage this software are not available in NetCraft. It depends on where SourceCraft, the maker of other development tools, plans to go with this freeware product.

For basic tasks and applets, NetCraft appears to be a good substitute for JDK users seeking to migrate to a graphical interface.

Pricing and Additional Information

For more details, and the opportunity to download NetCraft at no cost, visit the home page for NetCraft at the following URL:

http://www.sourcecraft.com:4800/about/netcraft/

The customer service number for the company is (617) 221-5665, and its e-mail address for comments and questions is [email protected].

Other Offerings

The following products for Java development cannot be described fully here, either because of availability or other considerations. However, they're profiled so that you can get a fuller picture of the IDEs that are available to you.

Borland C++ 5.0 with Java Enhancements

As described previously, Borland C++ 5.0 with Java Enhancements is a C++ development environment that has been extended to include Java programming tools. The advantages of this approach are multi-language development within the same environment for native method use, the ability to program in three languages (C, C++, and Java) without learning three IDEs, and software that has become robust from several years of use by the C and C++ development community.

The home page for Borland's Internet development tools is

http://www.borland.com/internet/.

MetroWerks CodeWarrior

CodeWarrior is one of several IDEs that have been made available in pre-release or beta form for Macintosh Java development. CodeWarrior is a multi-language development environment with an introductory version called Discover Programming with Java that is intended for novices. CodeWarrior can be used to develop programs in C, C++, ObjectPascal, and Java.

The home page for Metrowerks CodeWarrior 9 is the following URL:

http://www.metrowerks.com/products/announce/cw9.html

Java WebIDE

This development environment is worth looking at to see what's being attempted-a fully web-based programming tool that doesn't require downloading. You run it off the web page over the Internet, which is how many software packages will be run as Java development matures, according to the language's adherents. WebIDE is an experiment that does not supplant a more traditional IDE at this point, offering only source creation, compilation, and syntax high-lighting in its present incarnation. However, as more tools are added it will become more interesting, and WebIDE is one of the only development environments for Java that attempts full cross-platform support. The home page is the following URL:

http://www.chamisplace.com/prog/javaide/.

Kalimantan

Before it was christened as Kalimantan, this IDE was one of several Java-related products that staked a claim to the name Espresso. The developers have been kind enough to offer links to the other Espressos, so the Kalimantan web page is a good place to sort out any Espresso confusion that you might have. Kalimantan is another cross-platform IDE and it has been tested for use with Solaris 2.4 and up, and Windows 95 systems. Kalimantan's current beta release includes only an inspector to look at the values of internal variables and a debugger, but it is bundled with the teikade suite of utilities from PFU Limited. This suite includes a class browser that is familiar to those who have used class browsers with the Smalltalk programming language. The home page for Kalimantan is the following URL:

http://www.real-time.com/java/kalimantan/index.html

Natural Intelligence Roaster

Roaster was made available to developers in January 1996, making it the first Java IDE for the Macintosh. The current version at this writing is Developer Release 2.1. The Roaster Professional Edition includes a visual interface builder, compilation that can be targeted for Macintosh or Microsoft Windows systems, and an extended class library. The Sams.net book Teach Yourself Java for the Macintosh in 21 Days was written for the Roaster environment. Details on Roaster are available from the following URL:

http://www.natural.com/pages/products/roaster/index.html

Microsoft Visual J++

It is just becoming available in beta release as of this writing, but the company developing Visual J++ makes the product worth keeping an eye on. Visual J++ is Microsoft's machine-proprietary answer to Java development, and it features extensions to the Java class library that are specific to Microsoft's operating system. It integrates Java with the component object model (COM) integration through Microsoft ActiveX, and is integrated with the Internet Explorer browser that implemented Java with its 3.0 release.

There isn't a home page for this software yet on Microsoft's site, but the company's SiteBuilder Network, which provides an opportunity to download the beta release of Visual J++, is at the following URL:

http://www.microsoft.com/sitebuilder/

RogueWave JFactory

JFactory is an interface builder rather than a full IDE. It is used in conjunction with any editor and Java compiler. JFactory is a sophisticated interface builder with the capability to generate a lot of the support code that is associated with interface components, and it can import .rc and .dlg files created with other programming environments. The JFactory web site is at the following URL:

http://www.roguewave.com/products/jfactory/jfactory.html

Cosmo Code

Cosmo Code is an integrated development environment for Java that runs on Silicon Graphics IRIX operating system versions 5.3 and 6.2. There is a compiler, interpreter, debugger, and a class browser. The compiler can create machine-independent code, symmetric multiprocessing on SGI systems, and the creation of executable native code files. The Cosmo Code home page is at the following URL:

http://www.sgi.com/Products/cosmo/code/index.html

Summary

As you probably have discovered by this point, the decision about which IDE to use depends on your programming experience, personal taste, and the tasks you need to accomplish with your software creations.

Because developments occur at such a rapid pace in regard to Java, a trend that will continue for the foreseeable future, it is worthwhile to use the Internet to keep up with changes. As stated previously, one web site has been established to offer the latest news on IDEs, links to reviews, and a full listing of announced software. It's at the following URL:

http://www.cybercom.net/~frog/javaide.html#reviews

The Java newsgroups such as comp.lang.java, comp.lang.java.misc and comp.lang.java.programmer are another way to get a range of user opinions on the IDEs you are considering. Many IDE developers also participate in these forums, including the folks who created Café and Java WorkShop.

Most of the IDEs that have not reached the market can be downloaded as beta versions over the World Wide Web. You ought to make use of this before you choose a development environment. It's a hassle to install the software and deinstall its rivals, but even if the IDE doesn't suit your needs, it gives you a much better idea about what you do need in a development environment.