Files externally added to working directory not showing up in Eclipse - 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.

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

Questing regards opening a current existing project in Eclipse

I have a work space for eclipse for a particular project, which contains many small projects, it's a workspace for my hackkerrank progress.
I'm using my laptop at home and lab computers at uni, and I use github to keep them on sync.
I use source tree and git command line as version control tools.
And I gitignored .metadata folder because the workspace setting is different on different computer therefore it won't cause a chaos.
However, it causes a problem: though I can keep every project files on sync, whenever i create a new project in the workspace from one computer, the new created project won't show up in the other computer's eclipse project explorer, I know there is import function but that is not exactly what i want, because it is to import some project into the workspace, but I am in the workspace already with all the files/projects there, I just want some reference so there eclipse can see the projects.
Any help would be greatful

Eclipse Won't Load My Workspace Contents

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.

Eclipse: Files not showing in project explorer

There's a certain project I'm trying to open on Eclipse. But when I browse for the project's location and choose it, it loads and then gives me an empty project explorer. Why?
I don't know if this is relevant, but the project I'm trying to open has been created on a different machine than mine. And I'm mentioning that, because when I try to open a project that I created on my machine, all the files show in the project explorer and I face no trouble.
So what could be the reason behind that? And how can I solve it? Should I import the files rather than opening the whole path as a workbench?

Eclipse won't show files in package explorer

I don't know what went wrong, because this was working before, but all of the sudden I don't have any files in my eclipse package explorer.
The workspace path appears to be correct and the file permissions are correct.
Can anyone think of what's wrong?
Refresh the project
If that does not work, close and open the project again.
I had the same problem (Probably caused when I cancelled a copying to my Dropbox folder)
I only needed to click File → Import → General → Existing Projects into Workspace and select the missing projects in the window that appeared.
Workaround
Create a blank workspace
Navigate to (File > Switch to workplace > Other)
Clik Browse > Make new folder
Click Ok in browse window
Click ok in create workspace window
Import your existing project into the new workspace
Navigate to File > Import
Click General > Existing project into workspace
Click Next
Browse and select your previous project
Click on Finish
Congrats! Now you can see your project in the package explorer by importing it.
Project Explorer -> click on "View Menu"
-> Top Level Elements -> Click on "Projects"
Don't know what causes the problem, but found a way to get the files back into the package explorer.
If you go into the path of your workspace and find your projects, then you can pack them all into a zip archive file, and from this zip archive file you can import your projects again by using the File → Import → General → Existing Projects into Workspace menu.
I don't know what causes the problem, but in my case I think it have something to do with me having my workspace in a dropbox folder.
ps. I don't know if you actually can take more than one project into one zip file and make it work, I have only tried it with one project pr. ZIP-file, but it shouldn't matter.
In 2020 on OSX I just went to Project -> Refresh and wham! my files appeared.
I had started the wrong installation of eclipse. When I started the correct installation my code showed up fine. I have both C++ and Java EE installs.
Just refresh all the projects, you able to see all missed files after you import from a workspace.
1) Make sure that you use the right workspace.
2) Choose your "workspace"-Folder "/YourWorkspace",
NOT your project folder"/YourWorkspace/yourProject"
Alternatively delete your project from your
"YourWorkspace>/.metadata/.plugins/org.eclipse.core.resources/.projects/PROJECTNAME/.location"
and restart.
Hope this helps
I had the same problem. I was not able to see the imported files in Eclipse, but there were visible in File Explorer.
After a while, I noticed that all the files were imported. They had their names changed from myFile.class to ._myFile.class.
I deleted all the imported files from my workspace by using File Explorer.
By using the same File Explorer, I copy-pasted the folders/files in the workspace.
Then in Eclipse, I refreshed the project (F5 or click-right -> Refresh or File -> Refresh)
I faced the same issue and the reason was that I choose double click on Eclipse Icon, then I need to choose Work Space.
Here I made mistake. You do not need to select folder in which has all your project files
e.g //Desktop//User//Selenium//S1A//all files related to project
In that case for workspace you choose //Desktop//User//Selenium, import your project by clicking Import for eclipse 2020 and choosing File path //Desktop//User//Selenium//S1A.
may be a rare case like in mine, but if you played with colors this may be an issue and especially, if you changed theming and did not restart, which may correct some problematic visual stuff.
Import>Existing Projects into Workspace> Select root directory> Select the folder
The solution that helped me:
create a new folder (=Java-Package) with a new name. I used the System-Filemanager.
copy the disappearing files to the new folder (=Java-Package).
correct the links (JavaCommand 'import') to the new folder.
delete the old files and the old folder.
As the problem happened in my case:
I am using Eclipse IDE 2021-12 (4.22.0) for my Java project.
After importing an existing Project into Workspace all was fine.
While building the project, same files disappeared from the 'Project Explorer'-Tree.
These files still do exist as the System-File-Explorer shows. So no file got deleted. But no more listed.
After Refresh (F5) most of the files got listed again in the 'Project Explorer'-Tree.
Without doing anything an Eclipse background process let files again disappear from the 'Project Explorer' - Tree. Compilation of the project leads to missing files.
Sometimes 3 files disappeared. Some seconds later more files disappeared. Sometimes it leads to an empty Java-Package.
This disappearance of some files happened without any input from me. It was done by the Eclipse background process. It felt like watching a movie.
What does not help in my case: Restarting of eclipse, Close and Open the project, editing the files.
In my case, the problem was due to an unwanted nested project in a subfolder. There is a pre-set filter that hides folders in that case.
For some reasons, the sub project was not shown in Project Explorer.
My solution :
delete the project (without deleting project contents on disk)
import existing projects into workspace, and do not import nested project.
You might have filtered the resource out of the project.
Select the project, right click, choose properties.
Under Resource, choose "Resource filters" - check that the name of the folder or the files was not filtered in the list under "Exclude all" (if there is one)