Some files are not openable in Eclipse IDE - eclipse

For unknown reason, files of some types become not open-able in Eclipse IDE, for examples, *.txt, *.am, *.mak. When i right-click on files of those types in Project Explorer view, there is no "Open" or "Open With" menu options shown up like *.cc and *.hh. Those files types were use to be open-able within the same projects.
I confirm that the unopenable file types are associated with respective editors.
What may be wrong with my project or workspace settings?
[2013-09-30-update]
Still find no clue on why all non-c/c++ files cannot be opened by Eclipse IDE running on my Macbook :(
I imported the directories containing the files to create a project on Eclipse. The directories are mounted via Samba.
Any answer will be appreciated!!

Go to windows > preferences > general tab > editors > file associations and check your file type if its not present add them. It will be done.

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.

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 can I clone an Eclipse installation between computers?

How can I clone all of my Eclipse settings (preferences, plugins, etc) from one computer to another?
IIRC, Eclipse installs into a folder as opposed to all over the place like most Windows apps. Have you tried just copying the entire folder?
They are stored in the .metadata directory in your designated workspace directory. So you can copy that over, although some settings may not work right away as they contain absolute paths.
If you are referring to the plugins themselves, just copy the eclipse_dir/plugins folder
Eclipse has an import/export facility for general workspace Preferences:
File > Export > Preferences
Choose "Export All" and then provide a destination path and filename for your preference file (Eclipse will automatically add a .epf extension).
In a new (or existing) installation of Eclipse import the .epf file
File > Import > Preferences
Project specific settings, if you enabled (and configured these), are stored in the subfolders .classpath, .project and .settings inside the project folder. Assuming you preserve your project folders for use by the new Eclipse installation, your project-specific settings will remain safe.
Eclipse projects are also imported/exported via Eclipse file menu:
File > Import > File System
see this post regarding the way Eclipse uses the workspace .metadata directory

Where are projects stored in Eclipse?

The Project Explorer is able to list all projects in Eclipse. I am wondering where the project information gets stored?
The projects can be found under the .metadata directory of your workspace:
[eclipse-workspace]/.metadata/.plugins/org.eclipse.core.resources/.projects
Each project contains a .location file (in binary format) which presumably tells eclipse where the project is located on the filesystem, if it has been imported.
By default projects in Eclipse are stored under your workspace. You get asked where your workspace is created or which one to open whenever you open Eclipse, but you can configure it to not ask you again.
If you configured Eclipse not to ask again, then you can go to General -> Startup and Shutdown -> Workspaces in your preferences and check "Prompt for workspace on startup".
That page also lists your recently used workspaces (with probably just 1 entry, if you never explicitly specified a different one).
Note that you can also create projects that are located outside of your workspace, by explicitly specifying a separate location per-project.
Browse over to your workspace folder. You will see a folder for each project.
(Don't know where your workspace folder is? Try File -> Switch workspace... and it will give you the path.)
In Windows, usually C:\Users\%USERNAME%\workspace
Where %USERNAME% is the username given to your computer. eg. john
You can paste the above path in Run(Windows + R) window and it will pick the username automatically for you though.
For Eclipse Kepler SR2 on Windows 7
The easiest way to retrieve general info about a project (e.g., its location), see the following:
go to your "Package Explorer" view;
right-click on your project top-hierarchy folder;
choose "Show In" -> "Properties";
and you'll get the list of properties for that project in the "Properties view". Location of project will be in there.
On a Windows PC, you should be able to find your projects under C:\Users\yourname\workspace\. If you're on Linux, it should be under /home/yourname/workspace/.
I used the "Try File -> Switch workspace" suggestion which works but also re-installed Eclipse 0_0

How do you make NetBeans ignore files when searching for files?

In NetBeans when you go to Navigate -> Go to File you can search for files by filename. Is there a way to instruct NetBeans to ignore some files. It's picking lots of files from a tmp directory in my project which I never intend to open and it's just noise.
You can also add folders to the "Files ignored by the IDE" configuration.
Select Tools|Options and add the folder names to the regex.
NB: I have not yet confirmed that this achieves what is described.
In NetBeans 7 you go to "Project Properties" then to "Ignored Folders" and you just add your folders there.
You can configure include/exclude file patterns on a project by project basis. This feature will allow you to add an exclude pattern for your 'tmp' directory, which will stop 'Go to File' suggesting files contained in this directory.
To configure bring up the project properties (File -> Project Properties), select sources, and click 'includes/excludes' button. I.e.:
In my version of Netbeans (6.9.1 on Win 7), there is no button under Project Properties -> Source in which to enter exclusion patterns.
You have to go to Tools -> Options -> Miscellaneous -> Files and add the necessary file names or extensions under "files ignored by the IDE" in the Ignored Files Pattern field regexp.
For ignoring an entire folder, it is (in my version) on the project properties screen, but not under Sources; instead look at the "Ignored Folders" category.