Monday, March 26, 2007

NetBeans All-In-One IDE

NetBeans.org has been steadily improving their IDE - originally focused on Java, but now with the ability to create C/C++ programs. As most programmers know, whenever you can find single tool to do all your work in, you sell into it. With the C/C++ Development Pack installed, you can develop both Java and C/C++ application from the same IDE. I imagine it's even simpler now to create JNI-based applications in this IDE, in addition to offering full compatibility with JDK 6.0 and the Java EE 5 platform. Even better, it comes bundled with a Java application server (Sun Java System Application Server 9u1), making the effort to find the tools you need to develop solutions less. I've actually started developing my web and enterprise solutions in this IDE because it's easier and can talk EJB 3.0 and JavaEE5 all at once. Now if the IDE could speak AJAX ...

Setting up NetBeans 5.5 to start developing C/C++ projects is a simple process:
(1) Download the C/C++ Development Pack and install it.
(2) Install GNU compilers, debuggers, and make utilities. All these are conveniently accessible through a Cygwin setup process. The only other task is to set your environment variables after installing the utilities. At a minimum, select gcc, g++, gdb, and make - dependencies will automatically be selected by the installer.

If you have Borland C++ Builder installed, you might want to ensure that Cygwin directory paths come before those of Borland tools in environment variables. Otherwise when you attempt to build C/C++ applications in NetBeans, you will get make errors like:
"
Error Makefile nn: Colon expected".
Simply, Borland's implementation of MAKE is not compatible with the GNU version.

When you create a new C/C++ project in NetBeans5.5, it may complain that it couldn't find the compilers. The IDE makers could do a better job of reading environment variables without having to shut down the IDE. Meanwhile, simply close and check that the tools are globally visible from the command prompt (DOS):
>
cygcheck -c cygwin
> gcc --version
> g++ --version
> make -h
> gdb --version
If each of these command return a good version, restart NetBeans again at it shouldn't have trouble finding your tools. The only pain so far in using the IDE for C/C++ development has been the need to always set the includes directory every time (with every new project) - and having to restart the IDE for changes to take effect. I think the IDE could improve in this area as well.

Perhaps some day the C/C++ development pack will already include the minimal Cygwin utilities required and offer an option to install them when the pack is installed. I mean, they are required for the pack to work, so why not! Otherwise, it's an exciting tool and would recommend Java and C/C++ developers to consider it - yes, even Eclipse diehards (which I also still use). We love options.