Java代码没有正确更新 [英] Java Code not properly updating

查看:90
本文介绍了Java代码没有正确更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个奇怪的问题。



我用Java编写了一个代码(在Eclipse中)。然后,我对代码做了一些修改。现在,我试图运行新的代码(修改),但它仍然给我的输出,它是给以前的代码。



我在代码中放了几个调试点,但是它跳过了一些调试点(虽然它应该停在它们上面)并停止在某个调试点,但是即使在这里它调用了在该位置的以前的代码中存在的方法(虽然我已经评论过它们)。似乎从某个地方仍然调试旧的代码。



如何摆脱它?



谢谢

解决方案

您是否尝试清理项目?

 项目(菜单) - >清洁

还要确保

 项目(菜单) - >自动构建

被选中,以便编译所有新的代码,然后编译。 b
$ b

如果清理和构建不起作用,可能有一个jar文件包含您编辑的类,所以eclipse将在jar中运行编译的类文件,而不是您当前的档案。


This may seem a weird Q.

I had written a code in Java (in Eclipse). Then, I did some modifications to the code. Now, I am trying to run the new code (modified), but it is still giving me the output which it was giving for the previous code.

I have put few debug points in the code, but it is skipping some of the debug points (though it should stop at them) and stopping at some debug point, but even here it is calling the methods which were present in previous code at that location (though I have commented them now). It seems from somewhere it is still debugging the old code.

How to get rid of it?

Thanks!

解决方案

Have you tried cleaning the project?

Project(menu) -> clean

Also make sure

Project(menu) -> Build Automatically

is selected so that all new code you write is compiled then and there

If the clean and build doesn't work, it's possible that there is a jar file contains the class you edited, so the eclipse will run the compiled class file in the jar instead of your current file.

这篇关于Java代码没有正确更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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