My question is the following:
if you have a Java 1.6 compiler set in [window->preferences->java->compiler]
When you do [right click on project -> export as -> war]
or
[right click on project -> export as -> jar]
is it compiled with the Java 1.6 compiler? or with the one JAVA_HOME is pointing at?
The export operation (JAR or WAR, or anything) has nothing to do with the build process.
When you export, the workbench first ensures that all relevant projects are built. It does it by simply firing an Eclipse event to have a build done. Your projects will be built with whatever they were configured to be built with, using the compiler settings that they were configured to be compiled with. The compiler that is being used for the purpose is not necessarily the one that you have
JAVA_HOMEpointed at; it is the one that is defined in the workbench’s preferences.Once the build is done, the export handler performs the actual export of files from your workbench (which now includes the
.classfiles for each built project) into an archive (JAR, WAR and so forth).