Reputation: 11
Where does Eclipse save .java files for projects that are not in my workspace? Basically, I downloaded a project from a friend, and imported that project to Eclipse. I edited and created new packages and files in the project. Then, I exported the project and uploaded it to a file sharing website. A couple days later, (my computer had restarted since then), I reopened Eclipse. My files weren't there, so I tried looking for them on my computer and couldn't find anything. I went back to the website I had uploaded the files too, and all the files were completely blank.
I was thinking that the issue may have been the fact that Eclipse saves files into the project folder within the workspace. However, since the project came from my friend, that project didn't exist in MY workspace. If this is the case, then where was Eclipse storing those files whenever I saved them? Was it some sort of local memory within the Eclipse program that just gets erased when I restart my computer? Any information would be greatly appreciated.
Upvotes: 1
Views: 6262
Reputation: 34255
Eclipse uses the normal file system. But if you used the import wizard Existing Projects into Workspcace without the option Copy projects into workspace or the Projects from Folder or Archive import wizard, then the folder to import was referenced and not copied. Maybe you have then deleted the supposedly copied folder. In this case, Eclipse would display a closed project folder. You can right-click the closed project folder and choose Properties: in Resource the now deleted directory is displayed as Location.
To (at least partially) restore the files you edited:
In the recreated folder create the file .project
with following content (replace Foo with the project/folder name):
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Foo</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
In Eclipse open the project: right-click and choose Open Project
Upvotes: 0