Re-building a deleted class file in Eclipse

前端 未结 5 1067
Happy的楠姐
Happy的楠姐 2021-02-09 18:33

I accidentally deleted a .class (Java bytecode) file in my project (on the filesystem, not using Eclipse itself). Easy to fix, right? Just re-build it. But that doesn\'t work! E

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-09 19:18

    The OP answered his own question in the comments (2 and a half years ago):

    Found the solution: another project on which that project depended could not be compiled, because it could not be cleaned, because Eclipse wanted to delete the .svn directories throughout that project (I have no idea why), and it could not because some of the files didn't have write permission. I was happy to wipe out all the .svn data just to get this working! Thanks for the hint. – user690075 Sep 7 '11 at 1:25


    In regards to the bounty

    This question has not received enough attention.

    This problem keeps wasting hours of my time.

    IF the OP's answer didn't resolve your issue, you should ask a more specific question on a new post, describing what you've attempted and how the OP's solution didn't resolve your specific issue.

    That being said, assuming you did try the solution the OP posted, it is possible a different issue (that wasn't caused by deleting a class file) is causing the same error. Because you started a bounty on someone else's question and you can't get your prestige back I thought it would be appropriate to mention it might be worth your time to make sure your JDK version(s) are compatible between old or external source code used in your project. You'll get the same error NoClassDefFoundError when the compiler reaches a point in your code that references an object/class that's defined in a library that was developed on an incompatible JDK, it's missing key internal dependencies that are not found within your JDK version.

    I would go into more detail, but since this question is specifically about an error that came about from deleting a class file I don't feel it's right to do so.

提交回复
热议问题