missing source files - eclipse

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

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.

Related

Rescuing eclipse from bad workspace/project data

I would like to take a step backwards opening eclipse without it automatically opening the source files which were last open, nor the projects which were last loaded, I have reason to believe this might clear it all up.
Motivation being that as of a forced quit of eclipse, after it had gone stuck after some project changes, my eclipse Luna is no longer able to start without getting hung up again.
How may I accomplish that?
It's important to me not to lose my settings such as syntax highlighting and stuff, while performing the salvation... and whereas I am pretty certain I could locate my workspace directory on disk, would be nice finding where does eclipse keep the pointer to it, just to make sure I'll be tinkering with the right workspace, if needed..
I guess I could call it "starting eclipse in safe mode" :)

Overture/Stackoverflow/VDM projects corrupted/vanished

I've spent the past 2 weeks working on a coursework for College, I had pretty completed 90% of it. I decided to open Overture now and seems like all my projects have corrupted :((((((
http://gyazo.com/8e25549bbca700a22399e736a88a1996
If anyone has any suggestions/ideas about how I could recover from this I'd greatly appreciate it. I've tried 'Compare with -> Local history' but did not work. Little upset right now :[
The VDM source files in an Overture project are simple text. If those files are not corrupt (open them outside Overture with a text editor), then create a new workspace, create new project(s) and copy the files into them.
If the source files are corrupt, the only hope is if you have some sort of backup, I'm afraid.
We've never seen Overture corrupt sources before. The only component that could do this is the editor, and it deals with one file at a time. Do you have any idea why or when this happened? What version and platform are you running?

How to prevent NetBeans from remembering open files?

When I start NetBeans, I don't want it to automatically open the files that were open when I last closed it.
The only way I found to do that is to delete the following files:
del /q "%APPDATA%\Netbeans\7.2.1\config\Windows2Local\Components\MultiView-java*"
Is there a better way, e.g. an option that prevents NetBeans from saving the state of the open files on exit?
I know the question is very old but the issue is still there :) and the solution is the following:
Set/Open the desired starting files, project and then go to menu Window > Reset Windows.
It will remember whatever you had. So if you close all documents and call window reset, you will have no default opened files, which might be great for some of us.

How to know if a Scala file modified with IntelliJ Idea is saved and if it is checked into CVS?

I'm a long-time Eclipse user and I just now decided to try IntelliJ IDEA 9 (free edition) for Scala.
A couple of dumb questions:
How can I tell if a file I've modified has been saved?
How can I tell if I file I've saved has been checked into CVS?
I feel incredibly "exposed" to some sort of imminent danger when I don't see the familiar visual cues from Eclipse that indicate a file has been saved and/or checked in.
Thanks
In IDEA 11:
Settings->Editor->Editor Tabs->Mark modified tabs with asterisk
UPDATE
In IDEA 15:
Settings->Editor->General->Editor Tabs->Mark modified tabs with asterisk
Under Settings -> IDE Settings -> General -> Synchronization you can control when files are saved. I save files on Frame Deactivation (that is, switching to another program), and after 60 seconds of idle time.
You should also look at the Local History feature, which is a local VCS for your project, capturing all the individual edits between commits. This allows you to roll back changes that were made by the auto-save feature, which some people find unnerving at first.
If a file is modified but not saved, there's an asterisk, *, in its tab.
If a file is newer than its VCS counterpart, its name is displayed in dark blue instead of black. If it is not under VCS at all, it is shown in dark red. This goes for the editor tab as well as other places such as the Project window.

Help! Recover Eclipse file [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 13 years ago.
Improve this question
I'm using eclipse, when i close eclipse, it ask me save a file, I press yes and eclipse shuts down. When I open my computer I see that the drive only has 3 bytes left, and I get a bad feeling. I go to my file and oh my god, it's totally blank, size is 0 byte! :(
I need that file back, can a free recovery program can work on this case?
Sometimes Eclipse keeps the changes it made to the files you edit. Does not always work but it's worth a try :
Find you file in your (package, project, navigator) explorer.
Right click on your file and look for the menus to compare... (I recommend Compare though in your case it will not matter since the file is now empty)
Choose Local History... from the sub menu
If you are lucky and had been using Eclipse to edit the file you should find a few entries there. Look them up, chances are you will find the content.
This has helped me countless times and saved my ass on many occasions. However, every times I resort to it I always feel like hitting my head with a baseball bat for not commiting changes to the source control system earlier.
good luck, if that does not work I fear the SO will not be of much help to you :-(
--- EDIT ---
Little something that can help make this trick a tad bit more useful.
you can change the amount of information Eclipse keeps in local history, go to your preferences and then general->Workspace->Local History (Indigo here, may be different on other versions). If you tend to be light headed or burn the midnight oil a bit too much this will help you repair the next day that bug fix you insisted on finishing before going to sleep.
If you know some phrase or uncommon word from your file, you can search the raw sectors of the hard drive for pieces of text. This will turn up the text anywhere it might have been written: as paged out virtual memory, as a stil-existant file (temp file or saved file), or as temporary or saved file that was deleted and the space has not yet been rewritten.
But it will be slow. And if the file was never written to disk, it will yield nothing. And what it yields may be fragmented or incomplete.
Boot a Knoppix CD and start grepping! Knoppix is a linux installation that runs from CD, without writing to your hard drive.
get knoppix: http://www.kernel.org/pub/dist/knoppix/KNOPPIX_V6.0.1CD-2009-02-08-EN.iso)
Boot it. Start a terminal. Search the hard drive:
$ sudo grep "Four score and seven years" /dev/hda
If it turns up anything, copy and paste to a text editor, and save to usb stick or send it to yourself via web-based email.
If you have SCSI or SATA disks, you need to use /dev/sda instead of /dev/hda
The other answer is correct, every moment that OS continues running decreases your recovery chances. pull the power and use another computer to prepare the knoppix CD.
First, turn off the computer. Every second that it is on and being used at this point reduces the chance you'll recover your file.