This is a simple issue: the default behavior of eclipse is to start tomcat even if the project has compilation errors.
How I turn this “feature” off, so that eclipse complains about compilation errors and prevents Tomcat from starting?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t turn this feature off in Eclipse.
There are several things to note here:
Tomcat is an external process, and you publish to it. So, what you really want is that you don’t publish to it when you have an error. You could have an error in a JSP, in an XML file, anything.
Tomcat may already be running. What would you do in this case? Restart the server? Remove the class file from the tomcat config? You can’t always do this. For instance under windows, if the file is open, then the .class file can’t be deleted.
Also, when Eclipse compiles a java file, and it finds a compilation error, it still creates the class file, but with something like[*]:
which means that the class file is technically valid.
When you’re running external processes, you are no longer under the complete control of Eclipse, so the same rules don’t apply. You can always ask for the new feature though.
[*] You can check this using jad or similar.