views:

67

answers:

3

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

A: 

at Program Files\NetBeans 6.8\etc there is a netbeans_jdkhome value.

Louis Rhys
It is set to `netbeans_jdkhome="C:\Program Files\Java\jdk1.6.0_20"`, my default JDK. If this is the relevant setting, NetBeans should be using the default compiler.
deamon
A: 

Check Your Java Platform Manager : Tools->Java Platforms

DanialAbdi
There is nothing about the compiler, but about libraries like rt.jar.
deamon
+1  A: 

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.

Andrzej Doyle