开发者

Why is Eclipse executing an older version of my Java program?

My program had a bug that resulted in a ClassCastException being thrown. I omitted the lines in my program that resulted in this exception, and made a few other small changes, but every time I run it, it appears as though the older version of the program is being run, since the ClassCastExc开发者_StackOverflow社区eption is still thrown and the stacktrace refers to nonexistent lines in the program!

Any idea why this is? Restarting Eclipse did not help.


If Eclipse can not compile a class due to a syntax error, it will use the last compilable version to run, until the current one is fixed.


What tends to help in these cases is to clean the build. Go to project, then select clean. In the resulting dialog you can select what to clean. Clean all would also resolve dependency issues.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜