Eclipse - files open with no tab title or and empty content window - eclipse

I just installed Eclipse on a computer and it has been working fine for the past few days. However it suddenly stopped working this morning.
When I double click a file in the File Explorer to open it, nothing happens - a new tab is opened, but the tab has no title, just a button to close the tab. The "contents" of the tab is just a light blue screen, with no text.
I have tried the following procedures, with no success:
Right click > Open with > various Eclipse editor
Reset perspective (I am in Java EE perspective)
Change perspective to Java
Opening different file formats (.java, .properties, .xml, etc)
F3 and Ctrl-Shift-T
Creating a new project and opening a file from there
Restarting, cleaning workspace
When I open a different workspace, the files open as usual, but I still want to use my old workspace.
I am using Eclipse JEE Oxygen.

Doing a re-install fixed the problem.

Try to create a new workspace and put all your projects there from the old one.
If it does not work, it's likely that there is an error in one of the projects, try to find it, delete the project from the new workspace 1 and try to open the file, repeat it until the file opens, if you make a mistake in 1 of the projects, then you can create new classes. and copy there codes from the old ones.
P. S. If nothing works, you can download INTELIJ and open your workspace there (generally Intelij is more comfortable than Eclipse in my opinion)

Related

Sublime Text 2 edited file-changes does not show when refreshing browser in Maven project

I am having problems when editing template-files(HTML-files) in my Maven-project. I have made the Maven-project an Eclipse-project with the command "mvn eclipse:eclipse" (if it matters). I am using the Apache Velocity Engine as template engine for this project.
The problem arises when I'm editing the files in Sublime, and then save the file and refresh the browser. The changes does not show! If I however open the template file in Eclipse, just open it, I can even just open and close it right away, and THEN refresh the browser, the changes will show.
I have done a test to see if this problem occurs on other simple projects as well, and with a single HTML-file and a simple http-server, the work I save in Sublime shows as normal.
Does anybody know what is happening here? Am I bound to keep on using Eclipse as a HTML-editor? :( Does the Eclipse project files prevent me from using other editors? Why are the changes only showing when I open the files in Eclipse?
Any help is greatly appreciated!
In order for the changes to take place you have to right-click the file in Eclipse explorer tab and choose "refresh" in order for the (static) changes to be reloaded to Apache. For dynamic changes you'll need to restart apache or use a plugin such as JRebel.
Eclipse copies the files to the "target"-folder in the webapp. Sublime(and others) does not do this automatically, so you need to do this manually, or by a plug-in that will copy the files on save.

Eclipse insists on opening java files in Sublime

We recently upgraded our copies of Sublime. Problem is now our developers that use eclipse are having trouble opening java files. It seems that Eclipse has for one reason or another decided that half of the java files should be opened with "Java Editor" (when you right click and go to Open With) and the other half should open in "System Default" which as it turns out, is Sublime.
Where is the button I press to reset this stupid thing so Eclipse will open java files in Eclipse?
Eclipse "remembers" when files were "Open with"-ed with a certain Viewer and opens that file always with that Viewer from than on (it gets highlighted in the Options list and overrides the file-association).
You could try to change it back to the default by choosing "Default Editor" in the "Open with" context menu option in Project Explorer for each file that behaves strange.
The default editor for a file type can be set through Window>Preferences>General>Editors>File Associations. If multiple editors are set for .java and it's bugging out then possibly removing all editors except the default will help.

How to clean window history in Eclipse

Right now I'm having this issue in Eclipse where I have an XML file open that's really big in which it almost crashes Eclipse. However this file being opened is saved in my window history, therefore I restart eclipse, it tries to open this massive file again. How do I clear the opened window history in eclipse?
I would prefer not having to clear my workspace entirely as I have mylyn data I want to keep. I've tried using Eclipse clean but this doesn't seem to do anything related to opened windows.
Your workbench information are saved in this file in your workspace:
.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml
or depending on your eclipse version:
.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi
You can delete it and eclipse will recreate the file, you can also try to edit it, but it's a big file and may be hard... Deleting this file all workbench related settings are lost but your projects stays intact.
Go to Preferences and search for 'workspace'. You will see the list of workspaces that you can delete.
Some alternatives:
Move or rename the offensive file so that eclipse is unable to open it.
File->Switch Workspace->Other to load a new workspace copying your workbench layout.
Just some thoughts, my experience is closing a file and then the program means that the program will not attempt to open the file once launched again.

Eclipse: Open in New Window

In Package Explorer I right-clicked on project and selected "Open in New Window". New Eclipse window was opened with that project. Then I closed old, "main" Eclipse window, so only new "project" window remained.
Now each time I launch Eclipse I have this "project" window with project name in window title and Package Explorer drilled down into this project. And I need to press "Up" button in Package Explorer to see all my projects.
How can I restore default behaviour and launch Eclipse with workspace scope and not project?
My original answer: Once you get the Package Explorer the way you want it, if you exit Eclipse cleanly it should come back that way.
My revised answer: It looks like a bug, even if you exit cleanly it comes back inside of the project. And in fact when you create a new window no matter what it puts you into the project. Even if you switch to the project explorer.
I found a way to fix it though, do a Window -> Close All Perspectives, then open the Java perspective and exit and come back in and you should be OK. I have filed this bug about it.
Close the project properly " File --> Close All", Then restart eclipse.
OR you can create a new work space " File --> Switch Workspace --> Other..."
Im not sure this is what you are looking for but the Documentation offers a command line option to select the start workspace:
The workspace is the physical location (file path) you are working in.
You can choose the workspace during startup of Eclipse or via the menu
( File → Switch Workspace → Others.

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)