Is it possible to make Eclipse (Helios SR2) NOT run your project on errors, instead of prompting for an answer or run anyway ?
Scenario:
In eclipse, I hit the Run button. There are compilation errors. Eclipse asks me if I would still like to continue with the run. I have the options of "Yes" and "No". I can also tick "Always run without asking".
In Eclipse Preferences, under Run/Debug > Launching there are radio buttons for "Continue launch if project contains errors", but they only give 2 options, "Always" or "Prompt". Other sections on that page give the options 开发者_C百科"Never", but not this one.
Now. I'd just like to never run if there are errors, without any prompt (a console message would be just perfect, but not required). Is that possible ?
IMHO this seems like a very dangerous and error promoting behaviour (especially the "always run without asking" selection!)
If there are compiler errors, then I want the run attempt aborted so I can fix them, and if the code runs, then I want to be able to rely on it to (at least) be free from compiler errors... Why on earth would I want to risk running code that contains compiler errors, and spend hours debugging weird behaviours in the execution, when the root of the problem is already known?
Wouldn't it be more natural to have "never" as default, and "promp" as an option?
Preferences > Run/Debug > Launching > Continue launch if project contains errors > Prompt Voila!
No. This is not possible.
But why would you want that? IMHO the prompt was the best eclipse (or any other s/w for that matter) can do. If you hit run, then you hit run, and you want the file to run.
Is there any specific reason why you would want to hit the run button and the want the project not to run? It is very highly possible that you think you did not hit the run button and hot it again wondering what happened, rather than expecting that the project has errors.
Use the Build button instead of the Run/Debug button.
The short answer is no. This is not possible today. The idea is that you often want to run the code even if there are errors in the code. The Eclipse Java Compiler can actually compile most classes, even if they contain errors...
精彩评论