为什么Eclipse执行我的Java程序的旧版本? [英] Why is Eclipse executing an older version of my Java program?

查看:45
本文介绍了为什么Eclipse执行我的Java程序的旧版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的程序有一个错误,导致抛出ClassCastException.我省略了程序中导致该异常的行,并做了一些其他小的更改,但是每次运行它时,似乎都在运行该程序的旧版本,因为仍会抛出ClassCastException并且stacktrace指向程序中不存在的行!

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 ClassCastException is still thrown and the stacktrace refers to nonexistent lines in the program!

有人知道为什么会这样吗?重新启动Eclipse并没有帮助.

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

推荐答案

如果Eclipse由于语法错误而无法编译一个类,它将使用最后一个可编译版本运行,直到确定了当前版本为止.

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.

这篇关于为什么Eclipse执行我的Java程序的旧版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆