开发者

Eclipse using wrong build while debugging

I am new to eclipse and java. The way I understand the directory structure is that you have source packages in src/ folder and they are built into the /build folder.

It was all working fine until recently. But today I tried debugging after creating a new class and it was throwing ClassNotFoundException when I 开发者_如何转开发do F11. On investigation, I found that it was using older versions of even the existing classes and not the new builds, and there was no .class file corresponding to my new class. I checked the build/ directory and it seems the builds are also old as it is showing yesterdays last modified time despite the fact that I have made changes today and tried to debug it. This problem is not limited to debugging as I exported the class into a jar file and it is still using yesterday's jar file. What could be the issue here? Is it not 'building' the classes? Have I messed up the default 'build' folder somewhere?


First you should check, that the "build automatically" feature is activated (menu "Project/Build automatically").

Next you should do a refresh of your whole project to tell eclipse to check for file changes that occured outside of the eclipse IDE.

If all that doesn't help, do a "Project/Clean.../clean all projects" inside eclipse.


I'd stop assuming and find out where Eclipse is putting your newer .class files. They can't be disappearing. Once you know that, compare it to the project set up you have and make sure that you know exactly where the .class files are going.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜