macdevcenter.com
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button

The IDEs of Mac
Pages: 1, 2

JBuilder From Borland

Sure, I just raved about IntelliJ's IDEA, but I like a lot of things about Borland and JBuilder too. You can get JBuilder 6 at http://www.borland.com/jbuilder and the prices vary from the free Personal Edition to the $1,000 Professional Edition or the $3,000 Enterprise Edition.



JBuilder is an example of a well-written application written entirely in Java. This is a first class application that looks and behaves like a native application on Mac OS X. In fact, those people at the BOF complaining about the performance of Swing on Mac OS X should compare the responsiveness of the pure Java application JBuilder to that of the native Carbon application Word.

After you install JBuilder, you double-click on a icon just as you would for native Mac applications. Here's a look at the same code presented by JBuilder that you saw presented in IDEA above:

JBuilder

Borland's JBuilder (Click for larger image)

You can see that the Borland engineers have really put a lot of effort into providing a Mac-like experience. JBuilder 6 is a single codebase for all of their target platforms. The look and feel of the target platforms makes JBuilder look like it has been custom-made for the platforms. Borland committed early to Mac OS X and their engineers have helped Apple identify issues with the Apple port of Java that needed to be addressed.

JBuilder provides a great deal of support for working with your code. As expected, some of the features are not available in the lower-priced editions. The code insight with JBuilder is very responsive and helpful. Change a method name or signature in the code and you will see these changes reflected immediately in the listing of methods and fields for the class at the left. Type in a method name and you will see a pop-up of allowable signatures. The code insight also helps by prompting you to write appropriate JavaDoc comments.

JBuilder is very well-designed and is highly configurable. You basically get the same JBuilder experience available on other platforms, it just seems to run better on a Mac.

In addition to code support, JBuilder provides the RAD tools for you to lay out your GUI if you'd like. The interaction between the graphical view and the code is fast and tight. You can modify the code and see the changes in the GUI immediately, or modify the GUI view and see the changes in your code.

There is also a view for working with JavaBeans that allows you to specify whether or not a Bean is serializable, to set the events that your bean can fire or listen for, and to take advantage of BeanInfo. JBuilder also includes a view for looking at the history of a source document. You can easily track the changes between versions and roll back your code. You can use JBuilder with a version control system such as CVS, or just depend on the history feature for versions that your machine is aware of.

The UML view gives a representation of the current class along with a collapsed view of all collaborating classes. Some of the implementation is a bit difficult. For example, in the picture below, the class satellite.model.Satellite doesn't extend anything. In Java, this is taken to mean that Satellite extends the common root class java.lang.Object. Notice that this relationship is drawn into the diagram. That is decidedly non-standard. The class Board in the diagram below extends javax.swing.Jpanel. You won't see that relationship until you select Board. Then the fields, methods, and relationships for Board are highlighted and the Satellite class is collapsed. This is not the UML support that products such as Structure Builder have provided in the past.


JBuilder's UML view (Click for larger image)

You'll notice that a couple of refactorings are available from this view. I would expect JBuilder's support for refactoring to grow and improve in the future. JBuilder is a mature application that contains a rich set of well-designed tools. It supports the building of enterprise and J2SE applications.

For the most part, I don't need all of the widgets they offer, so I find the price a bit high. Of course, your mileage may vary. Borland has been very good at quickly integrating support for new technology and techniques. For example, not only do they support the standard views of unit tests run from JUnit, they also provide their own view that lets you track down errors in your code using the results of the unit tests. From this point of view you can see that the cost of the tool is what supports future development.

Project Builder From Apple Computer

The best news about Project Builder is that it is part of the Developer Tools distributed free with Mac OS X. Again, if you haven't signed up for the ADC free membership, you should do so. In the past the software updates relevant to developers have been posted for free on the ADC site. The latest tools are the December 2001 release that includes support for AppleScript. Apple continues to develop the IDE. For now the Java support is not its strong suit.

Project Builder supports multiple languages and so is a compromise solution. As a free tool, it's OK for Java development but doesn't do much more than syntax color and provide a shell for compiling, building, and running applications. One of Project Builder's strengths is that it is a Mac product and so it produces double-click applications for the Mac. If you want to deploy your application on other Macs running OS X, Project Builder makes this process easy. Project Builder also supports CVS. Here's a screen shot of our same application in Project Builder:

Project Builder by Apple Computer

Project Builder by Apple Computer (Click for larger image)

One of the most consistent requests from Java developers is support in Interface Builder for Swing. Interface Builder is a RAD tool that allows you to design the GUI for applications that conform to the Aqua guidelines (you can see screen shots of Interface Builder in last month's Java article). You graphically add and manipulate Aqua widgets and then write the code that supports them.

For example, you would drag a button where you want it and then write the code that details how a button will respond to a click. There is no support for allowing Interface Builder to work with Swing applications. It would be nice for Java developers to be able to place the button and then fill in the code for a corresponding javax.swing.Jbutton.

There are, of course, layout issues. The Java layout managers do not layout applications according to the Aqua guidelines. Having basic functionality of being able to place components using Interface Builder would be a great help to Java developers and would make Project Builder a lot more attractive. You could even use the stub code generated by Interface Builder in your favorite tools.

NetBeans

You can get NetBeans at NetBeans.org. Follow the instructions for expanding and installing the IDE.

In particular, you'll need to use gnutar and not StuffIt to expand the tar.gz version. You'll also have to edit the runide.sh shell script found in the bin subdirectory.

Open runide.sh with TextEdit or your favorite editor. At the top you'll see the following:

# the value set here can be overridden by $JDK_HOME or the -jdkhome switch jdkhome=" "

In between the quote marks enter the location of your JDK home: /System/Library/Frameworks/JavaVM.Framework/Versions/CurrentJDK/Home. Save the changes and run the shell script and NetBeans starts up.

You can perform more changes to the shell script to improve NetBeans' look and feel or you can follow the installation instructions and set the look and feel when you run the shell script using the following command:

./ runide.sh -jdkhome /Library/Java/Home -ui com.apple.mrj.sing.MacLookAndfeel -fontsize 10 

The first flag sets the jkd home so you don't have to edit the shell script. The second flag enables the Aqua look and feel, and the third flag sets the font size so that the screen looks right. Here's a screen shot of Netbeans with the Aqua look and feel:

NetBeans IDE 3.3.1

NetBeans IDE 3.3.1 (Click for larger image)

If you would rather not mess with the shell script or even open up a Terminal window to run your IDE, help is on its way. The developer releases of NetBeans now include a GUI front end for running the application. Download the latest developer release, expand it, and look inside the bin directory. You'll see a disk image file named macosx_launcher.dmg.

Mount this image and take the file NetBeansLauncher and place it somewhere convenient (I've put mine back inside the bin directory). Double-click on it. You'll be prompted to find the root directory. Navigate to the NetBeans directory that contains the bin directory where you just found the dmg file. Now go ahead and use this application to launch NetBeans.

You can select Preferences from the Apple menu and change the look and feel settings. This application is basically a GUI front end to the shell script. The only way you know that something is unusual is that you have two NetBeans icons in your dock. One is for the launcher and the other is for the application.

NetBeans is an open source offering that is then repackaged and distributed by Sun as Forte. Much of the help that was present in IDEA and JBuilder is also available here in NetBeans. If you type "mover." inside one of the methods in the source file, then the methods and fields available to you from a class of type Mover appear in a pop-up window. You have a wide assortment of wizards for working with Beans, JSPs, RMI, Servlets, CORBA, and much more.

NetBeans has a ton of functionality. In my opinion, where it is lacking is in the usability and performance end. In an open source project it's fun to add a new feature. It's not as much fun to spend time improving the responsiveness of existing features, but this makes all the difference to users of an IDE.

I feel ungrateful complaining about a product that is made available for free by a community that doesn't get paid for their efforts. I do, however, find NetBeans to be a cumbersome tool to use. It does a lot, but trying to figure out how to perform simple tasks took some effort. Creating a project from an existing set of source files isn't hard once you figure it out. But for beginners it's not clear how to create a project and add existing files to it.

I looked in the File menu and the Project menu and stumbled around for quite awhile. You can avoid some of this start-up frustration by taking time to read through the ample tutorials and documentation provided. For example, I was annoyed at having to work with a bunch of small windows until I noticed that I could have opened up the Setup Wizard and could have chosen the full screen mode.

In his book Humane Interface, Jef Raskin cautions against the notion of an intuitive interface. Often we consider familiar models as being intuitive and unfamiliar, but perhaps better-designed, models as being unintuitive. That being said, I found that getting started with NetBeans was much less intuitive than getting started with JBuilder, IDEA, or Project Builder.

Eclipse From OTI

Eclipse is an open source project from OTI that will form the foundation of IBM's WebSphere Workbench. Erich Gamma (one of the Gang of Four and co-creator of JUnit) leads the effort for Java tools. There are a lot of very powerful and interesting features in Eclipse. Unfortunately it isn't available for the Mac. Eclipse is written almost entirely in Java. The sticking point is that the team decided not to use Swing and to use their non-standard SWT (Standard Window Toolkit) instead.

You can find out more about Eclipse at Eclipse.org. On the SWT page there is a list of target platforms. You'll notice that Mac OS X is not included, but there are efforts to write a carbon version of SWT. Andre Weinand is leading that effort and is looking for developers interested in helping out. You can find his March 22 version of the SWT for Mac OS X here. Join the SWT newsgroup on the Eclipse site for more information.

jEdit

jEdit is an open source Java text editor available for free from jEdit.org. You can download a Mac OS X version of the application that expands to a disk image (.dmg) file. Double-click on this file and drag the resulting jEdit folder into your Applications folder. Now just double-click on the jEdit application inside of this folder and you can use JEdit almost like any other native application. (As an aside, one reason I'm looking forward to Apple moving to JDK 1.4 is the support for the scroll wheel.) The strength of jEdit for Java developers comes from the plug-ins contributed by the community. Here's a screenshot that shows some of the available plug-ins:

jEdit

jEdit (Click for larger image)

For the most part, there's nothing here that couldn't be done with BBEdit or even with Emacs or vi. jEdit packages the capabilities much more nicely and makes it easy to call often-used functionality using the plug-ins. Where I saw NetBeans as overkill, others may see jEdit as underkill for an IDE or overkill for a text editor. I find it Mac friendly and easy to use. I don't expect too much from it, so I tend to be pleased with what I get.

Summary

There's a lot to consider when you choose an IDE. You may have budgetary preferences or constraints. In that case you may be more interested in the free choices. These include simple text editors such as vi, Emacs, BBEdit Lite, TextEdit, or jEdit. Alpha, a favorite of OzTeX users, should be available for Mac OS X in the next couple of months.

Also in Java Programming on a Mac

A Rendezvous with Java

Integrating Ant with Xcode

Transforming iCal Calendars with Java

Apple Releases Java 1.4.1 for Mac OS X

If you want to move up to free IDEs, your choices are Apple's Project Builder and the personal edition of Borland's Jbuilder, as well as the open source IDE NetBeans. Project Builder is not really focused on Java and so the tool may not suit your needs. NetBeans provides a lot of functionality but the usability and functionality may frustrate you.

JBuilder's free version does not include all of their tools. From time to time you find yourself wishing it would do something and then realize that it would if you pay for it. The free version is designed for hobbyists and students and not for professional developers in a commercial environment.

There are other free IDEs not covered in this article. ArgoUML and BlueJ are two tools that come to mind. You can use ArgoUML as a Java Web Start application or download it to your own machine.

As for the IDEs that cost you money, my current favorite is IDEA. Again you need to look at your needs. If you need support for GUI tools and are doing a lot of enterprise development, you may find that JBuilder 6 is a better choice for you. For code intensive projects, in my opinion, IDEA provides the most developer friendly environment. Finally, at this time, I found that Metrowerks' CodeWarrior is lagging behind other tools in their Java offering. Perhaps we'll see an improvement in the summer with their next release.

Daniel H. Steinberg is the editor for the new series of Mac Developer titles for the Pragmatic Programmers. He writes feature articles for Apple's ADC web site and is a regular contributor to Mac Devcenter. He has presented at Apple's Worldwide Developer Conference, MacWorld, MacHack and other Mac developer conferences.


Return to the Mac DevCenter.