Reputation: 157
I have been using Eclipse for several years without issue. I made changes to my java code as recently as last week without problem. Now, I have tried to make changes to my code and they are not reflected when I run the code. One example (and there are several) is I changed the URL I am trying to hit. I have a print statement to verify the variable is getting the correct information. It still reflects the old code.
I thought something may be cached somewhere, so I booted the server, but the problem persists. I tried removing some old projects just in case there was corruption from them, but the problem persists. There are a couple of references to this happening to others, but they always involve Tomcat or some other app I'm not using. My setup is just eclipse with java. My version is Mars.2 Release 4.5.2.
Upvotes: 0
Views: 5265
Reputation: 2030
Change settings to Save automatically before build in Eclipse,
Also, do this The auto-save is disabled by default
This saves automatically at regular intervals, say for example, 20s
Upvotes: 0
Reputation: 23
The answer from Marcos to enable "Project > Build automaticaly" helped me. It was automatically disabled during a recent update, I spent so much time trying to find out the issue.
Upvotes: 0
Reputation: 157
I am not sure what became corrupted. I attempted 1. export projects to a .zip file. 2. delete the workspace 3. open eclipse 4. close eclipse 5. open eclipse 6. import projects
This did not resolve the issue. Someone asked for the code where I see the problem. It was several places, but one example is
// String fileURL = "ftp://www.websiteIDoNotWant" + path;
String fileURL = "http://websiteIDoWant" + path;
System.out.println("FileDownloader, fileURL: " + fileURL);
The output I got was FileDownloader, fileURLftp://www.websiteIDoNotWant/2012/020/rkpt/rkpt0200.12d.Z
So, what ended up working was creating a new Maven project with new classes and copying the code one class at a time and pasting it into the new project. Whatever was caching the old code is not present in the new project. I will delete the old one and move forward.
Upvotes: 0
Reputation: 921
maven build clean install
and see if build is able to finish successfully.maven>Update
project.If all the above mentioned steps are successful and still you are not able to resolve the error, I guess cleaning your local .m2 folder and re-building everything from scratch might help.
Caching of java .class
files is a pain. It happens with me everyday and is all because my .class files are kept cached inside the tcServer and whenever I restart, the same files get picked up. Cleaning those files will force eclipse to re-compile all the java files and when you build and publish them to the tcServer, they'll get replaced.
Upvotes: 2