0

This is NOT a life or death issue. I do have a backup from 2 or 3 days ago. - I think the answer to this may be "Learn to always save & backup your files every night, before you turn out the lights and go home" but just in case there is a happier answer, here goes.

I was programing some Android/Java stuff in Eclipse. I left the machine on with eclipse open and a couple of source java/xml files open inside of eclipse and gave up for the night. When I sat down at the machine this morning, I had a message that windows had preformed an update, and had re-booted my machine. after re-logging in and opening Eclipse it showed the source files in edit windows and they looked normal, but as soon as I tried to type in the edit window, I got some kind of a message that "Files are derived, do I really want to edit them" (I could be wrong on the exact wording. I didn't copy the text down before hitting no or Cancel or whatever the choice was that I thought would get me out of there without doing anything). after I left that screen, it showed me a now blank edit window for the source files. I closed that and and tried to re-open the file from the Package Explorer, but it wouldn't open. So I closed Eclipse and took a look in the /src directory and it appears the source files are gone. I do have a backup from a couple of days ago, so it's not a life or death problem to go back, but my real questions are. 1- Is this a normal occurrence when a machine boots/power fails/crashes unexpectedly with source files open in Eclipse? 2 - Did I answer the "Files are derived..." question wrong? is there something I could have done at that point to rescue the file? Any comments welcome. - Joe

4
  • You should learn to use a version control system like e.g. git (perhaps thru github.com or gitorious.org etc) Commented Sep 23, 2012 at 20:17
  • occured to me once. i created another eclipse copy(another version) . imprted workspace into it and it opened flawlessly. then again opened earlier eclipse and it worked there too . Dont know the exact reason, but it worked. Commented Sep 23, 2012 at 20:20
  • @Basile Starynkevitch - Yes I know I should use version control, but even if I did, this was a case of (I hate admitting this publicly) I was just tires and lazy and went home without saving stuff and was curious if there was another answer to the "Files were derived" warning that I could have chosen. Commented Sep 23, 2012 at 20:25
  • @Ashish Gupta - The source files are actually missing when looked at with windows explorer, so copying the remained to another directory probably wouldn't help Commented Sep 23, 2012 at 20:25

1 Answer 1

2

If you remember where your files were, you could right click on the parent in the Project Explorer > Restore from History or Replace With > Local History. This feels like a very basic local VCS. Even though this is not an endless history, you can extend the size allowed for Eclipse to keep such previous versions.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks Mithril. Never knew this feature existed
Also added some extra - keep time & space - to the history file. This will probably be used more then I want to publicly admit - Joe

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.