Weird, why is some previous version of a class running [message #1703500] |
Sat, 01 August 2015 10:33  |
Eclipse User |
|
|
|
I have this class named DataBaseDemo.java and I had it originally set up to use MySQL but then I altered it to use ORACLE.
But I only 'half way' did the change and did a save and click the run button.
So I was struck dumb when it did run. Then I looked at the output and I could tell that it was behaving as if I never made any changes. What it is doing is running the older previous code before I made massive changes. It is ignoring the code that comes up on the screen even though I have hit the SAVE key many times.
So why might that be?
And more importantly how can I get it to 'forget' the old code and remember the new code?
|
|
|
|
|
|
|
|
|
|
|
Re: Weird, why is some previous version of a class running [message #1703627 is a reply to message #1703553] |
Mon, 03 August 2015 13:47   |
Eclipse User |
|
|
|
Let me establish a few baseline facts that might help you understand better what's going on and then help us help you.
- Eclipse automatically builds your project(s) whenever you save a source file; mostly "build" means compile the Java code into .class files, but there can be other steps, too.
- If there are any project errors or compilation problems, Eclipse might not produce a .class file, depending on how severe the problems are.
- The Problems or Markers views in Eclipse are the best place to see the current state of your project(s) with regard to build errors.
- As Ed mentioned, Eclipse's Resource Navigator view will show you a "physical" representation of your workspace, much like what Windows Explorer shows.
- You can use Project > Clean... from the menu to force Eclipse to clean the compiled code and re-build it.
- When you run your application/program in Eclipse, it creates (or re-uses) what's called a Launch Configuration to create the runtime settings, such as runtime classpath, VM arguments, etc. You can view the Launch Configs via the Run > Run Configurations... dialog from the menu. There you can inspect how your program is being run.
So, does your Problems (or Markers) view show any errors on the project or the file you're working with?
Can you take a screenshot of the Run Configuration for your program and share that? (also inspect it yourself to see if there's anything obviously suspicious in it).
|
|
|
|
|
|
Re: Weird, why is some previous version of a class running [message #1703785 is a reply to message #1703782] |
Tue, 04 August 2015 22:15   |
Eclipse User |
|
|
|
Well you've looked in the right places, but the results are unexpected (to me at least). The screen shot of the Markers view says the project has build path errors, but when you look at the build path it doesn't show any errors. <smh/>
There is something odd in the build path, though, maybe it's related: the .classpath file should not be listed under Libraries. Select and remove it, then click OK and see if the Error goes away (from the Markers view). Might even try Project > Clean after that, although it really shouldn't be necessary.
Also, your screen shot of the Markers view says there are 2 errors and a bunch of warnings; can you show/tell us what the other error is?
By the way, the absence of .class files is because
a) you did Project > Clean, which deletes the contents of the build output folder (bin/ in your case), and
b) Eclipse thinks the project configuration is broken and can't compile it. Once we figure out what that's all about, it will start building the .class files again (automatically).
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.44812 seconds