Eclipse Won't Load My Workspace Contents - eclipse

I recently deleted an account I was using on my Mac (Mavericks if means anything, although it shouldn't). I was using that account to run eclipse and saved all my files on a disc image before deleting. I took all the files and switched them into my current workspace but now they don't show up in the package explorer(although I can access them from My Documents). Can someone please tell how to make them show up in the panel? It's getting very time consuming to constantly have to open them through Docs.

If the files are in projects that Eclipse does not know about you need to do File / Import... / General / Existing Projects into Workspace.
If the files are in existing projects use File / Refresh to get Eclipse to pick up the new files.

If that doesn't work, you can always try recreating your project and then adding all the classes and other files through the file menu, add existing item. This way you can maintain the integrity of your project withouth having to change any of the packages or classes inheritance.
Hope this helps.

Related

java - Eclipse Helios SR 2 Package explorer error

I need help. I was starting to work on a new project in Eclipse and so I decided to rid my package explorer space of any past projects within the IDE. I had 2 projects saved prior to opening the IDE: "new" and "project 1." I proceeded to delete project 1 successfully from the IDE permanently without any issues so I tried to delete "new." "new" was a project directory saved on my desktop and upon deletion within the IDE by right clicking, it deleted random files and folders on my desktop as well as other files I'm not aware of within a second, completely bypassing recycle bin-around 50GB of files. I tried to recover most of the files but they are fragmented and therefore damaged. Is this behaviour normal in Eclipse?
Basically in eclipse when you create a project, you create in a workspace. By default the project gets stored in the work space folder. However you can give a specific directory to save your project
The work space folder will usually have information regarding the projects. In eclipse we have 2 kind of delete. i.e.
1) Logical:- Project will get deleted from work space but there wont be any actual delete of files.
2) Physical:- Complete deletion of project.
I guess you would have opted the second one and the project would be corrupt. May be it had some dependent files outside which got deleted also.
usually when I want to remove the project , I go for soft delete. When I completely want to remove the project then I browse and delete the project folder itself.
You can find other related help regarding Eclipse in
http://help.eclipse.org/indigo/index.jsp

Files externally added to working directory not showing up in Eclipse

When I make changes to my working directory outside of Eclipse, in particular when I update my project under version control, newly added files will frequently not show up in the package explorer. Usually they'll show up after about 5 or so minutes (no idea why) but today it's been an hour and I kind of need these files so it's getting to be a problem. I tried:
restarting eclipse
cleaning and building the project
opening one of the missing files using File > Open File
The last of these opened the file but didn't get it to show up in the package explorer, and the type represented by that class was still invisible to other classes. Any thoughts?
As discovered, you need to refresh your workspace or project to see changes made to the filesystem outside of eclipse.
The eclipse workspace manages access to the files it controls, fires deltas on file changes to allow incremental builders to operate, etc.
The way to refresh the workspace is to select your project name in Package Explorer and press F5.

How does Eclipse determine which projects to load for a particular workspace?

Does anyone know how Eclipse determines which projects are in a particular workspace? Is there a config file somewhere with this info? I have struggled (in vain) for several hours trying to figure this out. I'd like to be able to edit this config / check it into SVN...
I think Eclipse works much better if you manage just the individual projects in your version control system.
You can publish the set of projects that make up a workspace as a Project Set File (an XML file that can be created as Export > Team > Project Set), which you could put in your repository. This file contains the repository location for all projects, so that they can be checked out all at once.
I agree with Thilo that it is not a good idea to put the workspace metadata into your version control system.
However, in the spirit of answering the question and letting others make their own value decisions: The directory ${workspace_loc}/.metadata/.plugins/org.eclipse.core.resources/.projects should contain one directory for each project that eclipse uses to keep track of where the project is on disk and a whole bunch of other information.

How To Manually Add Project To Eclipse Without Using Eclipse

I'd like to manually create the folders/files on the file system that create a new project in a workspace in eclipse, and show up in the Project Explorer when eclipse is started and the workspace is selected.
What files would need to be created to do this and where would they need to be?
Please understand that I do not want to open eclipse and make a new project using eclipse. I want to make a new project without using eclipse.
I think you will need to do the following
create a .project file and whatever other files needed by your specific type of project (for example java projects need .classpath) in the project folder, you can find out what you need by looking at those files for another project.
In your workspace .metadata folder, this is where eclipse keeps information about the current workspace, I think the plugin responsible for project definition is .metadata/.plugins/org.eclipse.core.resources , you will need to create those files yourself, some of them are binary, so you will need to open up the source of that plugin to see exactly how it writes them. Depending on your project, you will need to write more .metadata plugin information (for maven for example).
There is no easy way of doing this. Each new project modifies many scattered files throughout the eclipse structure (if you want a list, make a new project and find files created/modified most recently, and/or search for the project name.)
Short of writing the files by hand, there's not much you can do. I found these links in my reseach, but they're both pretty old and seem to be dead ends:
http://www.eclipsezone.com/eclipse/forums/t107019.html
http://dev.eclipse.org/newslists/news.eclipse.tools/msg36546.html
Based on the answers of #shipmaster I think this will work.
Go the workspace and create a new folder as your new required project name.
Copy the contents like .project, .classpath, .includepath etc from any existing project and modify the same like project name, source folder, build folder etc in .project. Do the similar changes in .classpath etc as per the new project requirements.
Unfortunately this is not enough to create a project by just doing eclipse restart so we need to do an import project and point it to this folder and we are ready to use the same now and we see the new project created in eclipse!
try archiving the file .. right click on project ---> export --->archive file(in General section) ..after you archive it as a zip you can import it after.
IF you want to manually copy a pre-existing project to a new workspace,
I have a solution for you:
Copy the project folder.
Paste it into the new work space.
File > Import > General > Existing Project Into Workspace
Eclipse will now see the project you cut+pasted manually.
Why I am doing this:
I am doing this so I can build upon my scrum stories while keeping documentation via working files that each successive step was built upon.
E.g. Story #2 is built upon story#1 code. But I don't want to version them because I want to be able to open them up one after another to do a presentation on my work flow.

Eclipse and copying workspaces

What do I have to do to copy a complete workspace from one computer to another and be simply able to continue working on it on the other computer?
In general, a filesystem copy should be sufficient. If you run into problems with your projects, try removing the project from the workspace (without deleting the files) and then re-add the project, which will rebuild the metadata.
Make sure you shut down eclipse before you copy the workspace, and that the target computer has the same (or higher) eclipse version, including the same plugins.
Check that your workspace actually contains all the projects - when creating a project, it's possible to have its files situated outside the workspace.
If your projects use any external libraries installed on the system, install these on the other system in the same place (or adjust the paths).
Then, there should be no problem.
You shouldn't have any issues with a straight filesystem copy as long as your eclipse versions match up.
If they don't, the project metadata may not load correctly
You need to copy the whole folder which you select as your workspace at startup (or you once selected). All settings are included in there (even the opened files).
I use rsync for this. Works great.