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.

Bug 181307 - additional compiler options ignored by Run action
Summary: additional compiler options ignored by Run action
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: PC Mac OS X
: P4 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-27 07:59 UTC by Vince Kraemer
Modified: 2010-10-27 02:48 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
a sample project (10.78 KB, application/octet-stream)
2010-02-27 07:59 UTC, Vince Kraemer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vince Kraemer 2010-02-27 07:59:11 UTC
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)
Comment 1 Tomas Zezula 2010-03-01 05:15:24 UTC
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.
Comment 2 Vince Kraemer 2010-03-01 07:43:27 UTC
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...
Comment 3 Tomas Zezula 2010-03-01 08:11:33 UTC
>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.
Comment 4 Vince Kraemer 2010-03-01 09:37:29 UTC
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?
Comment 5 Tomas Zezula 2010-03-01 09:55:20 UTC
>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.
Comment 6 Tomas Zezula 2010-10-26 08:42:18 UTC
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
Comment 7 Quality Engineering 2010-10-27 02:48:30 UTC
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