Eclipse opens old versions of my project - eclipse

When opening Eclipse the project version is not the current one(it automatically opens the very beginning version of the project, not the current files on my drive).
I tried modifying the refresh settings in Preferences->Workspace, no luck. Also, when I right click->Refresh the project nothing happens.
I am using the last version of Eclipse Luna and the PyDev perspective.

have you tried go File then Switch Workspace e selected the right one? (even if ther is only one)
Some time it happend to me, maybe when i have eclipse opened and i click again on the eclipse startup app it ask me "load new workspace..." and it messup all

Try to look that its clearly the Workspace you would to use.
Do you have different Workspaces?

Try to check the location of the project.
Right-click on the project in Package Explorer and select "Properties"
Select "Resources" on right side and check the location.
If the location is wrong, try to import the right one using method as follows:
Right-click in Package Explorer and select "Import"
Select General->Existing Projects into Workspace and import the project.

Related

Eclipse projects are not visible in workspace folder

The weird part is I can see my projects through package explorer.
I can also export them.
But when I want to access them elsewhere e.g windows explorer, they are not there.
All I see is .metadata folder.
An unexpected shutdown of the system occurred not too long ago.
Edit: When I switched the workspace, created and opened a project, they're still not visible/accessible outside of the eclipse project explorer.
Any ideas?
You most likely haven't ticked "Copy projects into workspace" checkbox option.
File -> Import -> Existing projects into workspace:
It is possible that the projects were not put into the default, workspace folder.
To check this, right click on such a project, select Properties (it is usually available at the bottom of the list), go to the Resources tab, where you have the location of the project files displayed.
Obviously, there is a problem with Windows explorer and OneDrive in particular.
When I navigate to C:/Users/username/OneDrive/Documents/workspace or through command line I do see my eclipse projects.
But when I try to use 'Open file..' option from any application or navigate through Windows explorer, projects are not recognized nor displayed.

Can't Open Existing Project in Eclipse

I'm trying to open an existing Android project in Eclipse. I've gone to File > Import > General > Existing Project (or something like that). I've chosen the file project folder. But every time I try to open the folder, all I get is an error.
Some projects cannot be imported because they already exist in the workspace*
Is there any other way of opening my project?
You cannot import a project with a name already present in your current Eclipse workspace.
The surest way to work around that is to switch workspace (menu File / Switch workspace), and create a new workspace (in which you will be able to import that project).
A more complex solution would be to try and rename an existing project in your current workspace.
Check other causes in:
"Some projects cannot be imported because they already exist in the workspace error in Eclipse"
"Erased project from Project Explorer and cannot re-import it"
"How to import a project which you just deleted in eclipse"
I faced the same issue, But it is as designed. When people close the project, It simply makes the project unavailable in the eclipse project view. This is why people thinks that it has been completely removed from the view.
So All you have to do is to go to
Window -> Show view -> Project Explorer
Now you will see your project in the Project Explorer sidebar with a different closed folder Icon as shown in this image.
Once you right click and open project you will see the magic you are looking for.
I had the same problem and I solved it finally.
So, lets say you want to open "TEST" project on eclipse. And you project is in this path: C:\Users\Sabina Comp\Desktop then your workspace should be C:\Users\Sabina Comp\Desktop not C:\Users\Sabina Comp\Desktop\TEST.
You can switch workspace by going to File->Switch workspace->other
I hope it will help you!
Just delete the .project file and try to open the project again in Eclipse File Explorer :)
I faced the same problem. Maybe the cause of your problem is as simple as mine.
I closed (not delete) my project in the Java Browsing view. Unlike the Java view, the project becomes invisible in the Java Browsing view. So I thought I deleted the project. But turns out my project is still in use when I try to import it.
So I went to Java Browsing view and right click the blank space in the Projects panel, click Open Project and the project is back!
Right click on a working set --> properties.
You should be able to see all the projects that are available in your workspace. Select it.
Next all the projects should be listed in your working set.
Here's what worked for me:
Right click on the project > Source > Format
I guess you want to create a copy of the existing project and make changes to the new one. Or you have got a project whose name matches the name of the existing project and you want to import the new project as well.
In the first case , you just need to simply copy(Ctrl+C) and paste(Ctrl+P) in the package or project explorer in the eclipse and it will ask you for a new project name -- rather than copying the project folder in the windows explorer and renaming the project folder name.
If you have copied the project in windows explorer and tried importing the project in eclipse you will get the above error Or if u have got a project whose name matches the name of the existing project in eclipse also you will get the above error.
Solution for both -- is to delete the .project , .classpath and .settings files and import the project. It will successfully import if u have changed the folder name.
Tip: If its a maven project , you can import it as a Java Project and then RightClick on the project and Configure->Convert To maven project.
In my case, problem was -
I deleted the code directory from its location.
And at the same time I closed Eclipse.
So when I reopened Eclipse, it searched for project and couldnt get it.
I restored the code directory at original place.
Opened Eclipse.
When tried to import project again I found it in closed condition.
I opened it and it started working properly.

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)

How to open project from workspace in Eclipse?

I imported an Eclipse project into workspace and after some time I deleted it in Eclipse (from project explorer but not from workspace). Now, I want to reopen it, or import it again, but I cannot import it because such a project already exists in the workspace and when I try to open it, in tab Project -> Open Project, it is disabled. Of course, I can delete the project from workspace and import it again, but this is not what I want. So the question is: how can I open the project, which is in Eclipse's workspace, but has been deleted from the Eclipse's project explorer?
This is exactly what I just ran into. The 'Finish' button is greyed out, as is the check box and project name in the project window. If you try to check that check box the project will not be greyed now, but it won't check. Refresh does nothing.
The trick (or is it a bug) is to uncheck 'copy projects into workspace' hit the refresh button and it will now be checked and you can hit the finish button. Project will now once again be available in the Package Explorer.
(I'm using Eclipse 3.8 and ADT 21.0.1)
These Steps You Have to Follow
Click File menu
In file menu click Import
A window is open Now click General Folder
Now click Existing project into workspace
Then click the select from root directory
Now import project which you want......
You have to choose the project in the workspace, not the zip file with your project. Your project is still in your workspace, and because Eclipse wants to copy the project from the zip file you chose (look at the checked check box "Copy projects into workspace"), you get that warning.
Just select "Select root directory" and choose your workspace as your root directory and choose the project you want to reimport (and make sure, that the checkbox "Copy projects into workspace" is not checked).
Go to “%ECLIPSE_HOME%\configuration.settings” and delete the workspace listed at the key RECENT_WORKSPACES
Restart Eclipse, go to File>Switch Workspace>Other… and select your workspace dir again
Now I could create new projects as always
One simple trick is to delete the project from your work-space directory manually and than try to import project again. That's it...
I've experienced this same problem. It was a deleted workspace which I re-imported. When I tried to work with junit tests in the directory, it said that parts of if were not in the "project" In order to fix this, I had to check the "SEARCH FOR NESTED PROJECTS" and that corrected the issue.
I know that this is a really old question, possibly the solution was not available back then, but on my system (Eclipse Photon 4.8.0) it works like this:
File menu
Open Projects from File System...
Here you can give Eclipse a path to a directory (in this case your own, currently used workspace directory) where it will search for possible projects, list them and let you choose which one to import into the workspace. It will show already imported (aka. existing inside Eclipse) projects grayed out and unselectable, but has an option to hide these as well.
After selecting the project you'd like to import just click the Finish button and voila.
Make sure that your project is included in current workspace, then you have to see the project under "Project Explorer".
Note: you can view this from: Window->Show View->Project Explorer.
If you are facing this:
Some projects cannot be imported because they already exist in the workspace --> "Finish" button is grayed --> hence, no way to open the project(s)
Solution:
Go to File -> Open File...
Choose any one file of your project, and the entire project folder will open in your present workspace.

Moving project to another folder in Eclipse

I generally have my working projects sitting on folders on my Desktop. When they are completed I just move them to a c:\dev\. The thing is I'm doing it in a rather archaic way.
1. move project files
2. delete project on Eclipse
3. create new project on Eclipse on the new location
How to you guys move projects around?
If I could alter the: File -> Properties -> Resource -> Location path it would be dead simple!
Example move:
c:\user\desktop\project_123
c:\dev\project_123
Right click on the Eclipse project in the Package Explorer, select Refactor, then select Move... In the dialog that comes up, enter or navigate to the new location and click OK. This will also preserve your CVS or other SCM metadata, but will also bring all your modifications as well, and you won't lose any memberships in Working Sets, launch configurations, or other things that Eclipse associates with your project.
Use Eclipse's Move menu item
Open Navigator view, right click on your project and click Move. Then select the destination directory.
Navigator View > Right Click > Move
Note it doesn't seem to work in Package Explorer (at least not in Neon). The move dialog from Package Explorer is different, so use the Navigator window.
I don't know whether eclipse has made modifs since the date of this post...
In my case I had moved a project folder manually and I wanted Eclipse to open the project on this new location. This is what I did (and it seems to work).
(I'm using eclipse "helios" v 3.6.2)
File menu | Import ...
General | Existing projects into Workspace
Select root directory = top directory of your project on the new location
Finish
I rarely have any projects in Eclipse that aren't under source control, so all I would need to do is check the project out in the new location.
If you don't have source control, Eclipse works with CVS rather well out of the box, and it's pretty simple to setup CVS to run locally without a server: http://www.tortoisecvs.org/faq.html#cvsinit
WHEN EVERYTHING ELSE FAILS:
Copying an Eclipse project from one directory (let's call it old_dir) to another directory (let's call it new_dir):
Open Eclipse and specify the copied working directory in your new_dir.
Once it opens the project in the this new_dir, the projects listed under Project Explorer Tab might still be the ones contained in the old_dir (you can check it by right clicking each and following through: "Resource -> Linked Resource" to see the Path Variables values). Thus, they have to be removed from this work space. Delete the Nios 2 Application Project and the BSP Project from the Project Explorer Tab by right clicking on it and selecting Delete option which will pop a new window. In the pop-up window, make sure that the Delete project contents on disk check box is UNCHECKED before clicking OK to delete the Projects. Otherwise, it will delete it from the old_dir where you copied the project from.
Right click in the Project Explorer Tab Area → Import → General → Existing Projects into Workspace and add the copied Nios2 Application Project and the BSP Project from the new_dir.
Right click in the Project Explorer Tab Area → Index → Rebuild, otherwise the Nios2 Application Project will not be able to use the includes provided by the BSP Project.
Click on Project → Clean → OK to clean and rebuild the whole project.
When using console to talk to the NIOS, make sure elf's path is updated to the new project directory as well!
Right click on your project->copy.
right click in project explorer free space and right click->pase.
chose new folder and project name.
I copied the whole project to a new directory. After setting Eclipse to the new workspace it recognises the project instantly. Thus it was nothing further to do. I use Eclipse IDE for C/C++ Developers, Version Luna Service Release 2 (4.4.2).
For Eclipse Oxygen, to move a Java project, djb's accepted answer works well (in my experience just now), except having read comment by Basic May 14 '12 at 9:27, I tried to add my project XMLDiff to C:...\SVN\trunk\Internal Projects, and I got a failure with the rather cryptic message:
Problems encountered while moving resources.
Resource already exists on disk.
I had to move the project to C:...\SVN\trunk\Internal Projects\XMLDiff by creating a new folder, XMLDiff, in the browse dialog, and the result was C:...\SVN\trunk\Internal Projects\XMLDiff, not C:...\SVN\trunk\Internal Projects\XMLDiff\XMLDiff.
So this must have changed between Basic's experience in 2012 and Eclipse.3.
For Eclipse Oxygen
Project Properties -> Resource -> Linked Resources -> Linked Resources (Tab)