Eclipse and NetBeans are what's called IDEs, or Integrated Development Environments. These days, they will most likely come with features that allow the compiler to be run through them, and pipe the output through the IDE for easier debugging.
Just as well, you could always write with notepad and compile with good ol' command prompt.
I think Eclipse has built-in custom-made java compiler (for some sneaky purposes), though not NetBeans.
If you are about IDEs, there is Intellij IDEA which is comparatively more "professional" than Eclipse or NetBeans, however here are two problems with it:
- it is free only for SE development, for EE it costs some money (however most of colleagues I know purchase it for their own use at work - it is allowed);
- it really requires a lot of time to learn its most important features (since there are many of them).