Eclipse Package Explorer Oddity - eclipse

Recently whenever I open my workspace in Eclipse the Package Explorer has always defaulted to focusing on a single folder of all my projects/resource files. I've put up with this for a few months since I can just "Up to" to get back to the project level.
However, I'd like to get this sorted. Does anyone have any idea how I can stop Eclipse opening this specific folder as its default?

You've probably already found the solution by now, but I recently ran into the same problem and found a solution that seemed to work for me and thought I'd share.
Close Eclipse and open your workspace's workbench.xml file for edit:
gedit <yourEclipseWorkspaceDir>/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml
Search the doc for the name of the folder your Package Explorer keeps defaulting to. This should be the value of the path attribute in a line like this:
<input factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="<theOffendingFolder>" type="2"/>
Change the value of the path attribute to point to the desired folder, or delete that input line entirely if you want the Package Explorer to show you the default project level. Save the file and open Eclipse.

Maybe this is related to the files automatically opened when you start your workspace (because it was closed in that state) and the package explorer "Link with editor button". This button at the top right of package explorer view allows to synchronize the current visible file in the editor with the package explorer (personally I often use this feature but I know some of my colleagues hate it ;-)).
Hope this can help
Manu

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.

How do I make Javadoc files show in Eclipse Package Explorer?

I'm using the Android Developer Tools wrapper of Eclipse, and the EGit git plugin for Eclipse. I'm having a problem where I'm generating Javadoc, but I can't find it in the package explorer.
I go to Project->Generate Javadoc.
I'm using C:\Program Files\Java\jdk1.7.0_51\bin\javadoc.exe as my Javadoc command, and I select the package I want to generate Javadoc for.
I select the standard doclet with the following destination, where ReverseSentence is my package.
C:\Users\myname\workspace\ReverseSentence\doc
I check "open generated index file in browser", and generate the javadoc. It generates the Javadoc with no errors, and the index shows up in the main section of eclipse. However, the files don't show up in the package explorer.
I searched in the workspace through opening up the folder, and inside workspace\ReverseSentence there is a folder doc, which contains the proper Javadoc. However it isn't showing up in the package explorer.
How do I make it show up in the package explorer? When I used the regular version of Eclipse in the past (not the android developer tools wrapper), the Javadocs showed up there automatically.
What I've tried:
refreshing the project
closing and restarting eclipse
generating the Javadoc with an older version of the Javadoc command, which was what I was using in the other version of eclipse last time it worked (jdk1.6.0_43)
deleting the doc folder, recreating it, then trying to generate the javadoc in it (it generated in it but did not show up)
unchecking the filters which hide some things in the package explorer, (as shown how to do here: How can I get Eclipse to show .* files?)
I think that the problem is the destination folder/directory for your Javadoc files once they are generated. I encountered this same problem and discovered (finally) that the Javadocs were getting sent to a different folder than my package files were in. They went to the workspace folder I thought held all of my code also, but the code was going into a different repository. Maybe try looking for your code's location and then seeing if the generated Javadocs are landing somewhere else when they are generated. If this is the case, then the fix is to regenerate and send to the code's directory. This way, Package Explorer should be able to find and display them. Hope this helps!
Did you try by refreshing the workspace or re-opening the eclipse !?
Check the filters in the settings of the explorer. If something does not show up, usually the filter hides it. The filter can be accessed in the drop down menu of Package Explorer.

How to link files to package explorer in Eclipse?

I know there is a way to tell the editor window in Eclipse to link to the corresponding files. Say when you're on a file in the editor, it would be located in its corresponding project in the Package Explorer.
It shouldn't take more than enabling one option, but I am not able to find out where it is.
It's a very handy thing which avoids confusion as to which file belongs to which project, if you have files with the same name in multiple projects.
Could anyone tell me where the option is located and how I can enable it again?
Package explorer has an icon named 'Link with editor'. You can locate this way your currently editing file in Package Explorer view.
Alternatively, when you are editing, you may press Alt+Shift+W and choose Package Explorer to locate your file in Package Explorer.

Eclipse projects not showing up after placing project files in workspace/projects

I've searched for 2 days and can't find anything. I find things that are close, but not what I need.
I got a new computer recently and copied all of my projects over to my new computer.
I opened Eclipse and generated a workspace, which I then closed out of Eclipse and copied my projects into the workspace/projects folder.
I reopen Eclipse and my projects do not show up at all in the package explorer.
I know that I have the correct folders in the correct directory.
The closest thread I found to this is: Eclipse - Import an existing project?
but even that didn't help, my projects already meet that...
I have tried refreshing, reopening, fooling with working sets, etc...
Just because you have a project inside the workspace directory doesn't mean Eclipse opens it or even sees it automatically. You must use File - Import - General - Import existing project into workspace to have your project in Eclipse.
For Juno: (With Source in E:\workspace and destination in C:\workspace)
Copy project directory in its entirety to the workspace directory.
(e.g. Copy E:\workspace\HelloWorld C:\workspace\helloWorld)
Start Eclipse.
Perform: File --> Import
Select: General -- > "Existing Project into Workspace"
"Next >"
Check "Select root Directory"
Select with "Browse Button"
Select "C:\workspace"
A list of existing projects will appear. Just check the ones that are in Bold (To Be Imported) then press the "Finish" button.
Review the Package Explorer and your copied projects should now be there.
This problems comes while .metadata of current workspace has been corrupted due to shut down Eclipse Unexpectedly. So if you face this problem just do the following steps:
Create a new workspace.
Import your existing projects to your new workspace.
you made it!
I had the same problem over and over again the solution that a have found works for now
Close Eclipse.
go to workspace.metadata.plugins
remove org.eclipse.core.resources
Start Eclipse
Do File->Import
General->Existing Projects into Workspace and import all the project from the workspace
Netbeans allows you to do a simple filecopy.
As you know, Eclipse doesn't work like that. You must explicitly "import" files and projects.
If you do import, and if there are no problems, then they should show up.
I'd consider:
a) making a backup of your existing workspace
b) deleting and reinstalling Eclipse
c) Trying another "test import"
You put them in the workspace/projects folder. You should put them directly in the workspace folder and then do an Import Existing Projects into workspace.
in Eclips the Package Explorer
Right click on any viewable project and select Show in -> Project Explorer
Package Explorer -> Right click -> Show in ->Project Explorer
you should be able to see all the imported projects in your Eclipse workspace
Even I had also observed the similar problem. I had closed my eclipse project because of some reason and on restart some of my file added were not visible in explorer even though corresponding file were existing.
Following solution worked for me:
Select whole workspace (Ctrl+A) ==> Righ click and press Refresh.
Or you could try:
Go to File -> Switch Workspace
Select your workspace (if shown)
As I had imported my project from a "git clone", I had to select File->Import-> Git->Project from git -> Existing local repository
Here's a specific problem I ran into when downloading a project from the internet.
Make sure you unzip correctly if it's zipped, you can sometimes get an extra level.
Make sure you place the project in the project file, not directly in workspace.
See if .project and .classpath have been renamed to _project and _classpath. You can't rename them directly so open a text document called .classpath and paste _classpath 's contents in there, saving as all files, not a .txt. _classpath can be opened with notepad.
Import the project from the file workspace. It will look for a folder called projects, your's should be inside it.
Hope this helps :)
The following worked for me.
Create a new project in eclipse.
After creating a new project in
eclipse, right click and select import.
General Import > File System
Select all the folders under your project except the root one. Click
finish.
This would create the required meta data and other internal eclipse project file system which will display your project's files.
You can also import the project directly as a file system. Follow the above steps if you are unable to import it directly.
Hi i also come across same problem, i try many options ,but finally the most easy way is,click of down arrow present inside ProjectExplorer-> customize View->filter-> unchecked close project.
And will able to see all closed projects.
I have tried many of the option suggested but at last importing project in new workspace solved my problem.
I think there is some problem in metadata files in old workspace.
I just wish to add one important detail to the answers above. And it is that even if you import the projects from your chosen root directory they may not appear in bold so you won't be able to select them. The reason for this may be that the metadata of the projects is corrupted. If you do encounter this problem then the easiest and quickest way to fix it is to rid yourself of the workspace-folder and create a new one and copy+paste your projects (do it before you erase the old workspace) folders to this new workspace. Then, in your new worskapce, import the projects as the previous posts have explained.
Yeah.... i kinda see what you need. I just came across same problem.
Here is exactly what i did. Now, bear in mind, this some low level knowledge, since i'm just starting. I made my life complicated, so i needed solution. I kinda found it on my own, using different directions from above answers.
I switched from win 10 on HDD to linux on SSD, so i needed my few of .class and .java imported into new workspace.
First i made a mistake, not using export option on windows and i just simply copied all of files from src and bin folders on win 10 to src and bin folders on linux. Of course workspace did not see those files.
Solution was found in IMPORT tool (which i should have used right away).
I put all of files in src folder into zipp file, and moved this file to some arbitrary folder (Home folder in my case).
Go back to src folder and delete all of .java files (you won't be needing them anymore).
Then i opened my empty project and selected import from File menu in Eclipse.
In import window, under option General (first one) select Import Archive.
Now simply find your zip file, and Voila! All is where it should be.
Problem: After creating a PyDev Project, the project does not show up in "PyDev Package Explorer" ;(
Solution: This is what I do to see them all in "Project Explorer":
I am using Eclipse IDE 2019-12
click on "Resource" icon at the top right corner
Now you shall see all projects show up in "Project Explorer".
Tricky note: now if you click on "PyDev" icon, you will see less projects show up in "PyDev Package Explorer" Magic?
What I did wrong about it, I used "import" - > "Projects from Folder or Archive" because I thought it would be the same thing. You have to use "Existing Projects into Workspace". Maybe this helps someone.
I experienced the same issues and I just click on Window -> Show view -> then Project explorer.
Then I got my project that was inside my eclipse workspace.

Eclipse: All my projects disappeared from Project Explorer

It seems like all my projects (except one) disappeared from the view Project Explorer.
I'm using Eclipse Java EE IDE for Web Developers.
Version: Helios Service Release 2
Build id: 20110218-0911
Note: all the projects are present on the file system.
How to bring them back? Any ideas?
This happened to me. I'm still not sure how, but the reason was that my workspace meta data had become corrupted, probably due to Eclipse being improperly shutdown. The solution, as explained here, is to:
Note, steps 2 & 3 are optional if Eclipse isn't crashing, but just not showing any projects.
Close Eclipse.
cd /home/user/workspace/.metadata/.plugins
mv org.eclipse.core.resources org.eclipse.core.resources_bak
Start Eclipse
Do File->Import
General->Existing Projects into Workspace
Click the "Select root directory" field and browse to each subfolder in your workspace folder, and import.
For me, this was very tedious, since I had several dozen projects in my workspace, but it's the only solution I found short of restoring my entire workspace from a backup.
Edit: This answer is now quite old, and better solutions may now exist. Although I haven't had need to try it, I recommend attempting #antonagestam's solution first, as others have suggested it may be faster and more effective.
Edit: Since it's fairly simple, I'd recommend trying antonagestam's solution first. However, this problem recently re-occurred for me, and that solution did not work in my case. But neither did it interfere with this solution.
I had the same problem in Aptana, all of a sudden my projects were gone. Solved it by going to the drop-down menu in Project Explorer and going Top Level Elements -> Projects.
Go to
File --> Import --> General --> Existing Project into Workspace
Then,
In Root Directory Enter the workspace path where all your projects saved & click refresh as below
And Click Finish
I was having the same problem for Android projects in Eclipse. This link was very helpful in restoring the missing projects.
Go to 'File->Import->General->From Existing Project'.
Select the root folder to the Workspace.
Click on the 'Refresh' button.
Select the required projects and click 'Finish' button.
I had the same problem in Luna, Suddenly my projects were gone in start-up.
I solved this by select Deselect working set option in the drop-down menu in Project Explorer.
Note: I post this answer even this is not a right answer for this question.
Since I search for Luna and came here,while trying with discussed things I was find this solution. This may help others.
Click on Windows > Open Perspectives > java
, Press Ok. Project Explore will come back on screen..
My solution is
open view menu and select "Top Level Elements" and set "Projects"
If any of the previous methods don't work for you then delete your old workspace, create a new workspace and put it by default. You can do this by launching Eclipse twice - the second time it asks you for the workspace ;). Then re-import all your projects there and say "problem, goodbye".
Mona is correct - Make sure that you have the task list set to show ALL as the image shows. Click the arrow to the left of the project if you want to re-factor your filter. Reset your perspective if you do not see the task list.
Today 22-03-2016, I check again this question and using ECLIPSE MARS I solved with:
Having Eclipse opened, go on FILE -> RESTART
Go on same workspace and I have all project on "PROJECT EXPLORER"
Sometime also this operation, will solve (Clicking on Projects dor see all project!!)
So Other solution is:
if you use the "Task List" view of Eclipse, it will sometimes try to hide files or projects that it thinks are not associated with a given task (i.e. any file that was not opened while you had a certain task selected as the current task). If you want Eclipse to stop hiding files
in that case, you can just delete all tasks.
Or you may also restart your eclipse and by just closing the project and then opening it again (from the right mouse click context menu) the files will be restored.
If that doesnt get your projects back then check the "filters option" (Click on right corner of Project Explorer tab and open context menu. Select Filters option from menu) and make sure that your projects type isnt checked.
you should check the active Working Set - make sure it is off.
When this happened to me I had somehow set the Project Explorer to only display Working Sets. I had none, so nothing was displayed.
To fix it, I went to the Project Explorer View Menu (next to the Minimize and Maximize icons in the Project Explorer), Top Level Elements -> Projects.
Thanks to #antonagestam for pointing me in the right direction.
It seems it happens to us all. I was happily hacking away at javascript, nowhere near all the nasty hibernate java stuff, and boom, "cant find org.jboss.logging.BasicLoging".
I havent touched anything!.
After an hour or so of trying to make that appear, restarting servers, mysql, eclipse, adding jars that weren't needed before,I deployed the fix all solution, the off button.
Then zap, no project.
(I am still none the wiser as to why calling Configuration() should now require jboss-logging...jar, maybe I needed it all along for when bad things happen)
My input is
use git, keep as little of your stuff in the eclipse workspace area as possible. Then just import project from existing git repo when eclipse loses it's marbles.
I also lost my server config. it's there but eclipse insists there no server config stuff and bombs. So make another one, I've expressed my feelings about eclipse in my new server name, and copy your apache xml configs (workspace/Servers/I_Love_Eclipse) over from the original perfectly good directory.
Not sure how/why, but this happened to me once when I added a task to Mylyn. Seemed that mylyn was filtering my projects. When I deleted the task they all came back.
None of the answers provided here worked for me. My Enterprise Explorer was completely grey and I couldn't even import or reimport projects.
In my .metadata.log I saw this error:
assertion failed: working set with same name already registered
So I deleted these file:
.metadata.plugins\org.eclipse.ui.workbench\workingsets.xml
Now I can see all my projects. I didn't have to add them back again.
I found a solution that worked better for me. Under my home folder I found a workspace/.metadata folder. I copied this folder into my eclipse workspace, replacing the .metadata folder that had been there. When I started Eclipse everything was back to the way I had left it - all projects present, all open files were still open, etc. Just like nothing had happened! I'm using Neon.
As a preliminary (before reimporting everything), here is a solution to recover working sets in which project were (if any).
I had more than 100 projects and each was in one of 14 working sets.
If your top level elements changes (accidentaly or not if it is a bug) from "Working set" to "Projects", you only see projects that are NOT in a working set, and if, as I do, you don't have any projects outside a working set, you think all is lost because you cannot see anything (blank package explorer).
So the solution is now obvious: click on the top left small white triangle MENU, than select "Top level elements", than select "Working sets".
You also have the possibility to rearrange the working sets list items.
Hope it helps
Unfortunatly the working sets were empty after the recovery, but at least I
recovered their names.
Config: Eclipse Oxygen.2 Release (4.7.2) with Java 1.8 on Windows 10.
Got this issue on returning to an Eclipse project on a VM after leaving it untouched for maybe a couple of weeks.
I started to apply the accepted answer, but when I got to the step of renaming the folder and had exited Eclipse, I saw there was an instance of Eclipse still running. I realized Windows had for some reason started a second instance of Eclipse when I hit the taskbar button. The second instance had been unable to access the workspace while the first instance was using it.
Once I undid my folder rename, and closed and restarted the original instance of Eclipse, I was able to use File->Switch Workspace to get my normal workspace back.
Solution that Cerin provide, importing each time that this problem happens, could be boring.
So I've implemented a script that control if workspace setting exits: if not, restore it to default.
I have an eclipse shortcut icon on the top panel that execute:
/opt/eclipse/checkWorkspace && /opt/eclipse/eclipse
Script checkWorkspace is the seguent:
#!/bin/bash
ECLIPSE_CONFIG_PATH="/opt/eclipse/configuration"
ECLIPSE_CONFIG_FILE="config.ini"
ECLIPSE_CONFIG_SETTING="osgi.instance.area.default"
DEFAULT_WORKSPACE_PATH="#user.home/workspace"
ECLIPSE_LOG="/var/log/eclipse.log"
cd ${ECLIPSE_CONFIG_PATH}
function sedeasy {
sed -i "s/$(echo $1 | sed -e 's/\([[\/.*]\|\]\)/\\&/g')/$(echo $2 | sed -e 's/[\/&]/\\&/g')/g" $3
}
WORKSPACE_EXISTS=$(cat ${ECLIPSE_CONFIG_FILE} | grep ${ECLIPSE_CONFIG_SETTING})
# If workspace setting doesn't exists
if [ -z "$WORKSPACE_EXISTS" ]; then
echo "worskspace setting not exists, resetting to default." >> ${ECLIPSE_LOG}
newConf=${ECLIPSE_CONFIG_SETTING}"="${DEFAULT_WORKSPACE_PATH}
echo ${newConf} >> ${ECLIPSE_CONFIG_FILE}
else
# if setting exist but it is empty
vals=(${WORKSPACE_EXISTS//=/ })
length=$(echo ${#vals[#]})
if [ "${length}" -lt 2 ]; then
newConf=${ECLIPSE_CONFIG_SETTING}"="${DEFAULT_WORKSPACE_PATH}
confToReplace=$(echo ${vals[0]})
sedeasy ${confToReplace} ${newConf} ${ECLIPSE_CONFIG_FILE}
echo "worskspace exists but is empty, resetting to default." >> ${ECLIPSE_LOG}
else
echo "Worskspace already set:" "${vals[1]}"
fi
fi
Maybe could be semplified, but works.
I tried many solutions. I found mine in the drop down menu of the Entreprise Explorer:
- Deleting org.eclipse.core.resources has no effect.
- "Top Level Elements -> Projects" was already checked for me; swtiching with Documents has no effect.
- Selecting all extensions in the filter option of the drop down menu has no effect at first sight, maybe it solve part of the problem.
The solution come from "Unselecting documents" (third choice in the Entreprise Explorer drop down menu). I think that choice reset the filtering of documents displayed in the Explorer.
Hope it'll helps
JN Gerbaux
Tedious but it worked for me (Kepler):
Using the OS zip utility, zip everything below the project workspace folder to a zip file, to be placed in a separate directory (will use c:\tmp\workspace.zip as an example).
Unzip workspace.zip to the c:\tmp directory. Assume there's a project folder called Project1
a. Ensure all the files in Project1 have Full Control permissions for Everyone or at least 777 permissions.
Remove all the project folders in the Eclipse workspace.
Recreate each project one by one according to its original type (Java, Dynamic Web, etc.). (Will use Project1 as an example.) Do not add anything.
In Eclipse, do File -> Import -> File System. Then select c:\tmp\Project1 as a source
Select the workspace Project1 as a destination. Do not overwrite any file.
In Eclipse, refresh the project and test it. It should work.
Also had this Problem.
My Solution was to uncheck the Box PyDev: Closed Projects, even if those hidden Projects are PHP and NOT Python Projects. (Strange BUG in Eclipse/Aptana???)
Be aware that even "Closed Projects" (a Topic above Pydev closed projects) is also unchecked. So you have to uncheck both Settings.
this: eclipse shows only "open projects" in project explorer
All of my projects were closed and I had hid the closed projects in the settings.
So to open projects go to top right view menu, and uncheck Closed Projects option. Assuming it is checked already.
Do the following steps
File --> Import --> Existing Projects into Workspace
Select the root directory as ur old root folder
Finish.
Yahoo.. There is ur old projects again in ur project explorer
1) File > import > Existing projects into workspace
2) Choose your workspace folder
3) select all of your projects
4) finish
All are OK with above way !!!
File - Import - Existing projects into workspace - browse - choose your workspase - done!
If Eclipse was killed during a shutdown, the projects database may become corrupted (the project database is normally located in: workspace/.metadata/org.eclipse.core.resources/.root/1.tree).
A message like this will be logged in Workspace/.metadata/.log:
!MESSAGE Could not read metadata for '.../.metadata/.plugins/org.eclipse.core.resources/.root/.markers'.
The data is lost. You need to import your projects again (File->Import ->
General->Existing Projects into Workspace).
The list of projects that were in the workspace can still be seen in .metadata/org.eclipse.core.resources/.projects/.
Projects located outside the workspace will have a .location file with the path to the project.
I also had the same problem.
file>restart.
Projects and modules appeared after restarting the eclipse, but faced new error;
An internal error occurred during: "AppXray Indexing...". java.lang.NullPointerException.
So it's good to be on safe side, import the project again in a new workspace.
if you go to Quick Access and type in Projects you will get it your projects back.