If I tell NetBeans (6.9) to compile on save, NetBeans warns me the compiled classes are not identical to classes compiled with JDK's compiler. The Java platform is set to "JDK 1.6" in the same dialog. Which compiler is used by NetBeans? Why doesn't NetBeans use the JDK compiler?
alt text http://img814.imageshack.us/img814/3449/compileonsave.png
The Netbeans C/C module minimally requires a C compiler, C compiler, make utility, and gdb debugger. See Configuring the NetBeans IDE for C/C++/Fortran for instructions on installing and configuring the required compilers and tools.
On the main NetBeans menu, choose Build → Build Main Project. The output window shows a successful compilation. If the compilation isn't successful, make changes to the code in the editor window, and try compiling again.
The Apache NetBeans 14 binary releases require JDK 11+, and officially support running on JDK 11 and JDK 17.
Like Eclipse, Netbeans does not use standard javac
so that it can offer incremental compilation and compilation of classes containing methods that have syntax errors.
Unlike Eclipse (which uses its own Eclipse Java Compiler), Netbeans actually uses the internal API of javac for compiling, syntax highlighting, and error detection. This is a nice advantage, in that Netbeans is able to handle all of the latest Java language features and faithfully reproduces any nuances or bugs of javac's behavior.
sources:
Why doesn't NetBeans use the JDK compiler?
Quite simply because Sun's javac
is intended to be used for batch-based compilation from the command line of definitively valid files. Whereas NetBeans (and other IDEs) do incremental compilation as you type, and quite often have additional features such as creating classes for invalid files (so you can run methodA
if methodB
has a syntax error in, etc.).
Different tools for different requirements.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With