Netbeans 7.1 running old codes rather than new one

2019-05-28 22:59发布

问题:

Ok, this is really weird. I wrote some codes a day ago, and then edited the codes. Then after hours and hours of editing and rewriting and introducing new classes, I ran the codes, but then I go a response from a "System.out.println()" line that I had long removed. Basically, netbeans seems to be running a much older build of my codes. I've cleaned and re-built my codes and still nothing. It keeps running old codes.

What's going on?

回答1:

In Neatbeans by default settings will run your new code, even if you not build the project again (given that you have not modified the build settings). You can clean and Build the project again. If this also not works, just back up your codes and create a new project and include the source codes and run the project.



回答2:

I had similar problem. I hit "Clean and Build", and then "Run", and it worked.



回答3:

Well, Clean it well! Check for any read only folders in your bin that prevent overwriting of class file. Go to classes folder and check date and time class files got modified.



回答4:

Maybe you can try to clear netbeans cache

  1. close NetBeans
  2. delete cache folder (/home/user/.cache/netbeans)
  3. open the project and wait for scanning project to finish