This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Created attachment 94590 [details] a sample project steps to reproduce create an ant based java project open the project properties dialog Select Build/Compiling enter a bogus compiler argument... -foobar use ok to exit the dialog If you clean and build the project, you see the expected error message. init: deps-clean: Updating property file: /Users/vkraemer/NetBeansProjects/JavaApplication30/build/built-clean.properties Deleting directory /Users/vkraemer/NetBeansProjects/JavaApplication30/build clean: init: deps-jar: Created dir: /Users/vkraemer/NetBeansProjects/JavaApplication30/build Updating property file: /Users/vkraemer/NetBeansProjects/JavaApplication30/build/built-jar.properties Created dir: /Users/vkraemer/NetBeansProjects/JavaApplication30/build/classes Created dir: /Users/vkraemer/NetBeansProjects/JavaApplication30/build/empty Compiling 1 source file to /Users/vkraemer/NetBeansProjects/JavaApplication30/build/classes javac: invalid flag: -foobar Usage: javac <options> <source files> use -help for a list of possible options /Users/vkraemer/NetBeansProjects/JavaApplication30/nbproject/build-impl.xml:413: The following error occurred while executing this line: /Users/vkraemer/NetBeansProjects/JavaApplication30/nbproject/build-impl.xml:199: Compile failed; see the compiler error output for details. BUILD FAILED (total time: 0 seconds) If you Run the project you see this output... run: thisshould not execute BUILD SUCCESSFUL (total time: 0 seconds)
Turn off the Compile on save. When the Compile On Save is enabled the project is not compiled by standard compiler to be executed. In reality the build folder is synchronized with the internal caches which are using internal compiler. Clean & build does the distribution jar => it uses the standard compiler even when compile on save is enabled. If you want to use the standard compiler even for run (run-single) turn off the Compile on Save.
If the IDE is going to ignore options, the user should not be allowed to change the option or there should be some note/dialog/something that tells them their settings will be ignored...
>If the IDE is going to ignore options, the user should not be allowed to change the option As described above, these settings are used for building the output artifact (the jar file), they are not ignored. > or there should be some note/dialog/something that tells them their settings will be ignored... Ok, it can be stated in the CoS documentation. It should not be a part of the Project Priperties UI. Reassigning to docs.
Since this issue was prompted by a user question that I saw, http://stackoverflow.com/questions/2344464/compiling-issues-for-java-7-in-netbeans, it seems like there is a real problem in this area that needs to be addressed by documentation and code. Why do we want to force users to turn off one of our features to get the effect that our UI leads them to expect?
>Why do we want to force users to turn off one of our features to get the effect that our UI leads them to expect? As these features are orthogonal. The compile on save is not for a building product, it's for fast development updates. It actually do no compilation in the time you call run, it simply takes files from the IDE internal cache. The IDE internal cache has to use the internal compiler as it's also source of the IDE metadata. You definitely do not want to affect the cache by cmd options, selected platform, etc as you will be able to de facto turn off the java support & editor features by single option. When you build your product (jar file) these cmd options are used and passed to the javac of your project platform.
I've added a warning into the CoS checkbox (j2seproject). If you want you can do the same in the web project. Fixed je-main 3b31ef0d43f7
Integrated into 'main-golden', will be available in build *201010270000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/3b31ef0d43f7 User: Tomas Zezula <tzezula@netbeans.org> Log: #181307:additional compiler options ignored by Run action