IDE Comments and Recommendations

On many forums and newsgroups a common question is which IDE is best.  Individual choice will probably be determined by several factors, my opinion is that many of the big name IDEs do not deliver good value.  I have used Metrowerks Codewarrior and Symantec's Visual Cafe - neither of which was found to be satisfactory (not to mention a steep learning curve to just learn to use the IDE).  Sun's NetBeans is very good but requires a powerful machine with lots of memory (128 MB). Eclipse, JDeveloper and NetBeans also have some quirks that force undesirable directory structures (not maintaining all source in a common package matching directory tree). One of JCreator's best features is allowing a nice single directory tree for source code of all projects.

My recommendation was KAWA. Before it was bought out by Allaire and Macromedia it was inexpensive and easy to learn. Kawa is now an unsupported product.

From June 2001 to May 2004 I used "JCreator" which is a very nice IDE and is offered as Freeware. JCreator is fast, small and extremely easy to use with many very nice features. However it can be quirky and in particular it drives us nuts with classpath/output path issues (a bug the developer won't recognize and thus no hope for it being fixed).

From May 2004 to October 2005 I investigated and tried "Eclipse". Eclipse is backed by IBM but released as freeware and developed as a collaborative community project.

In October 2005 I tried "NetBeans" again (v5.0 beta) and discovered that with powerful current machines NetBeans runs acceptably well. In fact it seems like a nice combination of easy to use and full featured. NetBeans v5.0 beta turned out to be too buggy to use, but switching to v4.1 was not hard and worked very nicely. Switching again to NetBeans v5.0 introduced new issues with the Jar deployment but overall NetBeans 5.0 is an excellent IDE.

Oracle's JDeveloper 10.x is very much like NetBeans 5.0. JDeveloper comes in two basic flavors: standard and with J2EE support (you can also download their full "Studio" version which adds support for ADF). JDeveloper is perhaps the current best blend of easy to use and learn, yet extremely powerful and full featured.

Quickie Recommendations

JCreator - for new programmers JCreator is the most straightforward and easy to learn.

Eclipse - too "cutting edge". Very slick and powerful but this comes at a price of being difficult to learn and "non-standard".

NetBeans - excellent but weak on project management. Easy to learn, full featured.

JDeveloper - excellent. Very much like NetBeans but I personally prefer JDeveloper.


JDeveloper Notes

JDeveloper is very nice to install (just unzip and copy the files - there is no "installer"). Download the EE version if you need support for J2EE development. JDeveloper runs well on a powerful machine, but is the most demanding of the IDE's using 150 Meg of RAM to run.

JDeveloper has a very nice "deploy" tool/configuration. Unfortunately this must be run as a separate step after building your application. JDeveloper lacks the ability to compile just a single file (there is no "compile" just "build").

File; Erase from disk - is either buggy or misleading. It appears to only remove the listing from JDeveloper and does not actually erase from disk. Further testing reveals this appears to only be a problem with deleting projects not individual files inside a project. It actually works properly, deleting just the project file and not the other files (source) associated with the project. Thus inside JDeveloper it appears you've just deleted the entire project, but on disk only the project file was deleted not the source files.

JDeveloper includes the ability ("restore from local history") to restore files that were deleted by JDeveloper (this only works within a session - local history is lost upon exiting)!

An "application" is like a "workspace". Applications can contain many projects.

To use another project as a library in your current project there is no need to "export" it from the original project. Simply in "Project Properties" select "Libraries" and "Add Jar/Directory" and give the library a name and set the class path to the "classes" directory of the code you want available in this project. This is ugly though because the library listing just shows "classes" and isn't clear what you are including. Better is to deploy a jar from the other "library" project and point to that.

Make sure that when you create the project deployment profile that the "library" jar is included as a "contributor".

In other words to create and use a library:

Example of directory structure on disk:

OracleProj

Customer

Games

HoI (Application)

LeaderEditor (Project)

Library

Tests


NetBeans Notes

NetBeans usually uses about 120 Meg of RAM to operate.

The one annoying aspect of NetBeans is that it uses Ant to "build" your application yet it lacks an interface to describe how you want your distribution jar built for anything but a trivial single project application. NetBeans will nicely configure to use classes from other projects (libraries) for running inside NetBeans but fails to include those classes in the distribution jar.

I discovered that in the "build-impl.xml" ant file, in the initialization section (just before the compilation section) there is a target to describe how to build the jar:

<target name="-init-presetdef-jar">
  <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
    <jar jarfile="${dist.jar}" compress="${jar.compress}">
      <j2seproject1:fileset dir="${build.classes.dir}"/>
      <!-- Include the library in the jar -->
      <j2seproject1:fileset dir="${project.JavaLibrary1}/build/classes" includes="goofy/LibRoutine1.class"/>

    </jar>
  </presetdef>
</target>

The lines in bold I added to include a class from a library. (naturally the exact names will be different)


Eclipse Notes

Eclipse is huge (85 Meg) and certainly requires a powerful machine. At first glance it is daunting and I did not believe it would be worth the work to implement and learn it. If you do plan to switch to Eclipse plan several days to just learn to use Eclipse. After a few days of testing I came up with the following comments that have us strongly considering Eclipse as my primary IDE:

1) When creating a "class" you can specify the interfaces it would have. An example of this is a class that implements "MouseListener" the class creator wizard will automatically put in the code to implement "MouseListener" and all the methods required to implement it. Slick! It also allows you to extend a class and it'll automatically include the required declarations.

2) Auto creation of "getter" and "setter" methods. Since common recommended practice is to not make variables "public" but rather to use "get()" and "set()" methods for other classes to use variables inside a method, Eclipse includes a feature to automatically create getter and setter methods for the variables you select.

3) The "Task List" actually can be slick once you understand it. It can contain reminders of "TODO" items. All you need to do is make a comment that starts with "TODO" and it makes a "task" to remind you to do that.

4) If you want to use a class like "Collection" or "Hashtable" you can tell it to "Add an Import" and it will automatically put in the necessary import statement (very handy if you don't remember which package that class belonged to!). There are slick features to organize how the import statements are generated too (like how many imports from a package before it does a wildcard import. As an example say you use java.util.Vector and java.util.Hashtable. By default it makes these as two separate import lines. But if you change your preferences to "1" import before making a "*" then they will be combined to "import java.util.*". Very slick!

5) As you are writing code it "semi-compiles" it and can give you warnings before you've even compiled or saved your code. For instance if you declare a variable and then use it but don't initialize it there will be a little warning icon that you may not have initialized your variable.

6) "Local History" a feature I didn't even have a clue what they were talking about until I tried it step by step! Eclipse remembers the state of various elements (like a method in your class) through various "saves" as you work. You can select "local history compare with" and see a list of your past few saves - you just click on the various saves and you can compare the source code at each save level with what you have now! Incredible! That could save some head scratching and frantic cursing when you make some major modifications and find out you were better off with your original code! This also works as a reminder if you forget what you have changed.

7) There is a very powerful feature for "reformatting" your code to fit your preferred standards. This isn't terribly useful to me on my own code but it's great if you are working with someone else's code!

8) Automatically commenting large sections of code. In the past I could use /* and */ to comment out large chunks of code but this failed if there already was a /* */ comment (you can't nest those comments). With Eclipse you can select a block of code and then tell it to comment it and every line will get // comment markers in front of it. (uncommenting chunks like this is also supported!)

9) Incremental find - I'm not sure if this is really handy or not but if you do Ctrl-J you go into "incremental find mode" and if you start typing a word it will find the first occurance and then you can use up and down arrows to move to other occurances. It works fairly slick, just not sure what purpose it really serves.

10) "Quick Fix" - when you compile a class and it has errors they show up in the "Tasks". If you right click on one and select "Quick Fix" it will suggest possible fixes. I'm not sure how useful this is for a veteran programmer but it might be helpful for a novice. For instance lets say you have a variable "j" and you never initialized it. if you make a statement "k = j + 1;" it will give you an error that j may not have been initialized - quick fix will offer to initialize it for you (that may or may not be a good thing if you don't realize what you are doing).

11) Alt-Shift-UpArrow selects an entire logical structure. This could be useful if you need to see easily what all is inside a for loop or other logical structure. Handy perhaps for deleting entire structures and not leaving dangling { }. I think you'd have to use this many times before being comfortable with it (or remembering it exists!).

12) Surround with "try/catch" - if you write code that has an uncaught exception and you want to quickly put in the entire "try & catch" statements this can do it in a couple clicks. Really very slick (and handy if you don't remember or wish to type out the correct spelling of the exception)!

Eclipse is certainly "complex & powerful". And I was ready to just toss it as not worth the effort, but after digging nto these features it looks like it could be a "winner".