When you try the latest development builds of NetBeans IDE 6.5 then you can be surprised that the Build action is NOT grey anymore on java project (a little recall for those who are lost). How come? Well, we are listening to our users. They liked the Compile on Save feature but they were confused that they cannot Build their project anymore. The solution was simple - provide users a dialog with an explanation.
This dialog will notice you that your project is already compiled. So why are you compiling it again then, right? You can either switch the Compile On Save off in project properties or you run Clean&Build in your project.
The Clean action is enabled again too. It will clean your [project]/build directory.
This dialog will notice you that your project is already compiled. So why are you compiling it again then, right? You can either switch the Compile On Save off in project properties or you run Clean&Build in your project.
The Clean action is enabled again too. It will clean your [project]/build directory.






Haven't tried it yet, but UI and concept looks amazing!
Great work... :D
Posted by Varun on September 03, 2008 at 07:41 PM CEST #
Very Nice, I like when things are not Grey...
But If I do a Clean action...Then a Build action, I still see the popup, but if I click OK, I think my project is not built?
Bug?
Posted by ludo on September 03, 2008 at 08:19 PM CEST #
I think the compile on save logic is good, but I think greying out the build, and even this strategy isn't so great. It adds complexity for no need it seems. Just build the file again if build is called, or build the project. What does one do if they have files they changed externally? What force clean and rebuild? The user can read about the features to know they don't need to build. This seems to narrow the possibilities which isn't a good thing, and tries to show the user the feature by limiting the IDE.
Posted by Wade Chandler on September 04, 2008 at 04:08 PM CEST #
I don't care for the build on save. You can compile single files with ease and when you get big projects the auto build is annoying and having the build greyed out is annoying. My build is greyed out. I don't get the popup and i don't see anything on the compile properties to turn the save build option off.
Posted by Bruce Randall on September 05, 2008 at 12:20 AM CEST #
This is good news
Posted by Allen Montejo on September 05, 2008 at 06:42 AM CEST #
@ludo: As it's written in the post. Build action has no sense for projects that use CoS. Therefore when you click OK in the _informational_ dialog then nothing happens. You can choose from three buttons - 1, Project properties -> then you probably want to switch the CoS off 2, Clean&Build -> you hit the Build by mistake 3, OK - you understood the dialog and just wanna close it.
@Wade: yes it is more complex now. But you can expect that it will change in next release. Right now there is lot of users that are confused about the new feature. And this is a way how to educate them.
@Bruce: What build are you using? What kind of project?
Posted by Lukas on September 05, 2008 at 02:34 PM CEST #
@Lukas I still don't see why a Build action doesn't make sense for CoS projects. To me they could easily compliment each other. For instance, what if I'm using two editors or IDEs, and I only want to actually use one of them for building? What if I want to use both because, for instance, I can use Ant in one of them more easily, but I also want to keep things up to date as I work on them in the other IDE because I have to use the other IDE for certain IDE specific tasks? Would I still not like to have compile on save when I actually edit a file in NB? For me, yes.
What if one has other files which end up needing post processing after everything has been built, such as JasperReports or something similar, and the only way is to 1 make sure everything is compiled, and you don't want to perform a clean and build because this obviously takes longer, but instead want to just run a build to get anything missed and then generate this other information, and still would like to have the compile on save feature for the single files you are editing?
I have a current project at the moment which must use JDeveloper 9.x for certain things, and I'm using NB with automatic projects to do my coding as the editor just rules, and I also use NB to write my JasperReports. Due to some limitations of the iReport NB plugin I am using Ant post processing to compile all my reports on the fly based on my build.
Sometimes I have different file changes in the other IDE when debugging an issue or something and it is easier to fix it once I'm on the line in the other editor. As far as typing goes they are equal (as most editors are), just NB has more code helping features. I get I could have a target for the post processing, but having it build and get any possible changes and build the reports comes in very handy.
Now, with this simple blocking of a UI action, I will have to add another target to that project to build not only the reports, but to force the classes to be built. Not only does that mean I will still have the IDE do the same thing, but now I have to click more times just to get it to do that, and manually change some scripts, or turn off compile on save. Either way I will lose something when I could have the best of both worlds.
I get that folks may be confused about the feature, but if it is compiling on save, do they really care other than it is helping them out other than the boost at runtime while in the IDE? It obviously isn't packaging the application and building a JAR on each change. It isn't as if they really need to know unless they are interested in the feature in which case they'll look to see if it is happening if they are new, or will be checking out the new feature list and actively requesting the issue to be addressed, and will see that it has if they are current users.
IMO, this isn't really addressing a usability issue as much as it is making more just to tell the user the feature is on; leaving it to do what it does, take care of something in the background and speed some things up, seems should be transparent less documenting it both in new features sections, and in the user documentation in the IDE. Couldn't these projects have another layer on the icon with a symbol to represent the project has compile on save turned on instead?
Thanks
Posted by Wade Chandler on September 05, 2008 at 04:20 PM CEST #
That other layer on the icon I mention in my last post is more graphics on the icon. This could be on the build button, the project icon, or both. Even an icon could be visible on the build action.
Posted by Wade Chandler on September 05, 2008 at 04:23 PM CEST #
The Compile on Save feature is nice, but I'd like to turn it off. Maybe it is because our laptops are slower, but we keep having to wait 10 or 15 seconds to have control of the IDE again after a Save. The IDE keeps compiling and scanning at the worst times. When trying to make quick changes across different projects, we keep having to wait until the IDE is done compiling and scanning. Let me turn it off, so that I can go back to working quickly and only package the projects when I'm ready please.
Posted by Xendren on September 23, 2008 at 11:02 PM CEST #
@Wade: You know how it works -> fill enhancements
@Xendren: you can turn the CoS off, of course. Look at http://blogs.sun.com/coreqa/entry/why_is_build_action_grey However maybe your problem lays somewhere else. What project type you use? What NB build? Is your source code in a VCS?
Posted by Lukas Hasik on September 24, 2008 at 11:17 AM CEST #
I had to disable COS.
I edit my java files in netbeans but also outside the ide (with vim).
COS doesn't understand that the date of a java file can be changed outside the ide.
I think it is a pity because in my opinion this can be fixed.
Posted by Kees Kuip on October 05, 2008 at 11:29 AM CEST #
Hi,
I use the latest daily build and for me COS does not work. All I want is an automatic build on save. I have a JEE project with Wicket. What's wrong?
Ciao Frank
Posted by Frank on October 15, 2008 at 12:22 PM CEST #
This needed feature does not seem to work for me. Just downloaded 6.5 (Windows version), went to set COS flag, changed and saved a file, and nothing happened. The document tab shows uncompiled icon that disappears only after forced compilation (F9). Generation of class file under build/classes happens accordingly.
I do not understand what is going on here.
Bye!
Posted by Zsolt Kúti on November 24, 2008 at 12:33 PM CET #
@Zsolt: could you look at http://blogs.sun.com/coreqa/entry/compile_on_save_all_you ?
Posted by Lukas on November 24, 2008 at 12:39 PM CET #
@Kees: it should work even in this case.
@Frank: there is only Deploy on Save for J2ee projects.
Posted by Lukas on November 24, 2008 at 12:40 PM CET #
Hi Lukas,
Thank you for the link. I am getting to feel desperately, however. I have an idea how it supposed to work and find NB does it differently.
Excerpts from the FAQ (and this is written at COS option, too):
The class files in userdir are always up to date (...). On the first run the classes are copied to build folder and the application is launched with this folder on its classpath. After any further change&save in editor the class files are updated in both places - in userdir and build folder.
I can't see this working under build/classes: "After any further change&save... files are updated in both places"
I have experience with the other two contender IDEs, and had no problem "using" this kind of functionality. As a matter of fact, there was no need to care about it at all. I expected the same here. For me "Compile on save" means what it claims regardless what is written on a long page of FAQ.
The most I could see that after changing/saving a file the class file is not updated, but on clicking "Test project" it does. Trying some further changing/saving and "Run main project" resulted in the rebuild of the whole project (compile what has changed, no more)! COS as a naming is very disturbing for me. "Compile on run" is more close.
A subtle issue, a visually misleading one is that on clicking "Run main project" the tab icon does not change. It does, however, on finishing running!
Bye!
Posted by Zsolt Kúti on November 24, 2008 at 03:25 PM CET #
@Zsolt: Did you run you application first? The CoS is designed to make running application faster so all it's effect are visible only after 'Run project'. The CoS realy means the file is compiled on save, the FAQ page describes only how it work internally and justifies the decision which were taken during the implementation.
Posted by Jirka on November 26, 2008 at 01:59 PM CET #
@Jirka: Thanks for answering! It is tempting to further plea, but seeing I am the only one with my objections I'd better stop here.
Posted by Zsolt Kúti on November 26, 2008 at 02:35 PM CET #
Funny, I thought my install was broken when I couldn't compile. Really freaked me out.
By the time I figured out what was up and adjusted, they'd already changed it back. Go beaners.
Posted by James Arlow on January 09, 2009 at 02:21 PM CET #