Eclipse code completion automatic deactivation - java

Whenever I run Eclipse, it suddenly deactivates some completions tags (but not all) with no reason. This happens always during, when I write some code. At the start of Eclipse, everything is okay but after a while this problem occurs. Every time I solve this by resetting the preferences and restarting Eclipse. But it takes too much time and annoys me.
Is there a special Hot-Key to (de)activate some completions tags?

I would bet on a plugin malfunction. Try to reinstall Eclipse from scratch without any custom plugins, and add only what you need, then add them one by one until you run into this problem.
Alternatively, open Eclipse->preferences->install/update->unintsall or update (link)->configuration->view error log and see if you get any exceptions on any plugins, if you identify something fishy, uninstall that plugin.

In my case the Eclipse Preferences named Type Filters (under Java | Appearance) seemed to cause that experience. We had excluded all common root package names (com., org., sun.), but also java. and javax.*. After deaktivating those entries in the "Filter list" Eclipse's Ctrl-Space again provides the missed proposals.

Related

Sudden weird errors on a project

Today I came to work, happy. But when I opened my Eclipse, I saw that one of my projects has errors.It's weird because it shows that it has errors only in the window bar, and not in the Navigator. I don't have any Java errors, this is a valid project that was fine all the time:
Some of the errors on the error log of Eclipse:
JavaBuilder handling ImageBuilderInternalException while building: SP_Procedure
Cannot connect to VM
File <SomeFile> has been skipped, problem while reading ('Resource is out of sync with the file system')
Unhandled event loop exception
Internal error
When I run an application from this project, I get a warning message but when I proceed, it works fine, but still. It's very disturbing and I'm not sure if it's harmless.
I tried to:
Restart Eclipse
Restart my machine
Clean projects and recompiling them.
Refresh projects
Pray
Nothing helped. What could be the problem? (I'm using Indigo Service Release 2)
The following nuclear option has desperation written all over it. But I have been where the OP has been with the Juno version of Eclipse.
Run a "Synchronize with Repository" and save all of your local updates to a different directory.
Delete the project. (Check the box to delete the contents on disk. Scary step, but that's OK, because you saved it in a different directory in the previous step, right?)
Read in a fresh project from the repository. It builds happily at this point.
Integrate your local updates.
Keep on praying.
Looks that one unused JAR was deleted, but for some reason, I didn't get errors in any file, even in the files that imports this JAR! So what I did was restoring this JAR, delete unused imports and deleted the JAR again.
I've found this error after two days of navigating on this project on each file.. This is weird that Eclipse didn't recognize that1 this is an error, and throw many unrelated errors such as:
Cannot connect to VM
File has been skipped, problem while reading ('Resource is out of sync with the file system')
Unhandled event loop exception
Is this a bug in Eclipse? (All errors and warnings are enabled!)
1 As seen in the image in the question..
A class from the list of imports for the file seems to have moved out or the jar file containing the class is missing.
Expand the imports section and check if you find some classes that are missing but have been imported.
Though it is a pain, sometimes the easiest solution is to back up all your projects (either in a repository or somewhere else on your computer) then uninstall and reinstall eclipse. No it's not fun, but it should reset eclipse so everything works again. The downfall though is that you have to reconfigure eclipse to any special settings you had/reinatall any extra functionality currently installed (eg. android add-on) and reconnect to any repositories you have. While punting isn't fun, it can be effective... I hope you don't have to resort to this though.
I have went through that problem a lot of times, and tried everything you tried. Rebuild, recompile, refresh, remove and add JDK, remove and reinstall Eclipse... nothing worked
The only thing I concluded is that the workspace metadata was corrupted.
What I did (every time it happened) was
Create an empty workspace
Import -> existing projects into worskpace
Mark the "copy projects" (else it will only link them)
Wait for the copy, and start working with the new workspace
If you work with SCM systems (Git, SVN, etc), making a full checkout will do the trick too, but the worskpace import will let you retrieve those changes you didn't get to commit (if any).
It's a little painful if you have somethings already set (like JDK names, servers, etc), but then I realized it was faster than keep searching how to fix the workspace
Regards!
PS : I've been working with Kepler lately, and everything works fine till now
Click Window -> Show View -> Other -> General -> Problems
This view will show you what is wrong.
Did you, by any chance, update your virtual machine outside of Eclipse? I can't help but feel that we're both missing a finer detail here. I just keep seeing "cannot connect to VM" and thinking that it's a major clue.
Have you tried running anything from the terminal? Does it work there?
If so, do you know where your current edition of Java is located? Is Eclipse looking somewhere else?
Is this exclusive to one project? Do you use any additional libraries to the JDK?
Maybe try this for Resource is out of sync with the file system error:
Right click project in Eclipse Package Explorer
Close Project.
Right click project in Eclipse Package Explorer
Open Project.
Other things not mentioned:
project properties > java build path, see if any of those tabs got changed, local file got moved? read/write permissions on some file you are linking to?
project properties > java compiler, see if workplace settings have changed? maybe under errors/warnings, you can systematically set them to 'ignore' until the error goes away to determine what type of error it is?
maybe update some of the eclipse plugins?
I saw something like this happening for a number of reasons. Mainly because of validation in files other Java source code. See if you are validating XML for instance.
Right click your project and chose Properties (Alt+Enter) and Validation to see the related configuration.
As for the danger, I lived with those marks for ages and nothing wrong ever happened.

Eclipse building the code again and again (without any changes)?

I am noticing a strange issue with Eclipse Indigo. It is Building Workspace again and again even though there is no change in the code!
In Progress bar it prints
Building Workspace 44%
..
Building Workspace 10%
..
Building Workspace 33%
Any idea what is going on here? For the time being I have unchecked the 'Build Automatically' flag.
I have tried the following trick couple of times and this seems to work more often than not:
Uncheck Build Automatically flag
Refresh all the projects in the workspace
Re-enable the automatic build after sometime by checking the Build Automatically flag
Note that as I mentioned earlier this is a trick and not a resolution. But, hope others facing these issues will find this helpful.
Yes, I have noticed that too and it can be rather annoying. I have reverted to manual compiling in Eclipse by switching auto-building off (under project).
Compiling manually is a bit old-school, but it works for me. I prefer to compile, package and test the code at the command line using maven.
(I'll probably get a downvote for this approach (i.e. not using integrated tools, etc.), but it works for me and it works well! At least I'm not using VIM for coding Java! :))
If you are using Windows 7, then the Windows indexing in some directories can cause automatic rebuilds in Eclipse: see Bug 342931 - Windows 7 Libraries trigger rebuilds.

exception has been caught while processing the refactoring 'Rename package'

This refactoring function in Eclipse for package names used to work for me fine until... today:
This is the first time I am receiving this weird Refactoring error, and I have no idea what to make of it:
An exception has been caught while
processing the refactoring 'Rename
Package'.
Reason: Problems encountered while
moving resources.
Click 'Undo' to undo all successfully
executed changes of the current
refactoring. Click 'Abort' to abort
the current refactoring.
What could possibly explain this sudden "change of heart" and how do I fix it?
Seems from your snapshot that you are running windows 7, maybe vista. If its not a renaming issue, try running eclipse as administrator. It might be permissions-related, but its just a thought.
I see merit behind what Kurru is saying. Windows is not a case-sensitive operating system, meaning that is sees the words Cat and cat as the same thing. When you rename your package, Eclipse creates new directories/folder to put the package in. If you changed the case of your words and not actually rename it, it could throw this error.
Under Windows this is frequently caused by a file or directory being locked. There can be several reasons for this:
A file is open in a viewing program outside of Eclipse. Windows will not allow the open file to be refactored.
A CMD.EXE is active in one of the directories to be refactored. Windows will not allow the directory to be moved or deleted.
A program is running with open files for items in the workspace. Windows will not allow the items to be refactored.
If this is the behaviour of a freshly started Eclipse on a freshly started machine, it is probably not Windows, but a corrupted workspace or Eclipse distribution, and you should unpack a fresh Eclipse and create a new workspace in which you can import (and copy) the existing projects from the old workspace. I don't think this is the problem, though.
If you're just trying to rename a package to the same name, only with a different case, this error is thrown for me. Very annoying when trying to fix package names to the lowercase convention.
Had some success renaming packages to a step folder, then to the target folder...
ie.
APackage -> apackage FAIL
APackage -> APackage2 -> apackage SUCCESS
Got the same error. It turns out that my ClearCase (version control) plugin was inactive. Simply activated the version control plugin, and the problem was solved.
This can be caused if using characters like underscores in your class names (e.g. My_Class.java). The project will build and run fine. But in Eclipse, if you run Android Tools > Rename Application Package, the rename will fail.
Same refactoring problem occurred to me when I was working in the Ubuntu. The cause is the permission limitations. Eclipse cannot re-factor as it does not have permission. After giving root permission, refactoring worked fine for me.
If it is the problem because of case. I have successfully tried a solution.
This will fail
org.xyz.fileName ---rename---> org.xyz.filename
This will pass
org.xyz.fileName ---rename---> org.abc (rename the structure)
org.abc ---rename---> org.xyz.filename
This will work fine!
I just restart the computer and start STS(Spring Tool Suite 4)
and delete the file/class its works for me.
Check if the folder location is open in the Command prompt. If yes, then close it and try again.

Eclipse 3.6 freeze on autocomplete/quick fix

I have a problem that seems to come up both with autocomplete and quick fix. Sometimes when I use cmd+1 for quick fix dialog, Eclipse freezes and however long I wait (30 min at least), nothing happens. When inspected in activity monitor, it seems to exhibit little to no processor activity.
I have a Mac with OSX 10.6, and Helios with no weird plugins. I program in java, so I use very standard features.
Is this a known bug? I have tried to google a lot to find useful info. I am not very good at reading bug reports though, and the concept of feature freeze kind of taints my search results.
Thanks for any help.
As for Eclipse you can not know what is happening. The whole platform is a set of plugins, and the requirements (for example responsiveness) are not strict for them. So a third party or even a bundled plugin can cause such a failure. So most of times you cannot have a clue about what is wrong. Some stuff you can do:
while hanging unplug your network connection. If you are behind a proxy for example, a plugin can wait for a long time on network io
you can check with for example resource monitor, which file eclipse opened. Some of the opened file handlers can have relation with the problem
edit .classpath file in project where code completion freezes, and it will "reset" your project stuff in eclipse
you can browse .metadata folder in eclipse workspace and you can guess which folder to remove temporaly. After removing, try if error is still present
create a new workspace and import projects into it
if new workspace do not work, then the eror is in configuration folder in eclipse root, and you can play the same thing like in step 4
use a brand new eclipse
+1. Maybe some new plugin is responsible. In eclipse Help/about/installation details/Installation history tab you can revert to some older set of plugins.
Hope it will help.
Seems that you encounter known and already fixed bug.
Issue fixed after deleting all the files in the below directory
configuration\org.eclipse.osgi\.manager
.fileTableLock
.fileTable.1
.fileTable.2
There will be fileTable lock files, delete all those files

It is taking too much time to run my application in eclipse

Whenever i run my application in eclipse it starts building and then runs. As i am haing thousands of classes it taking too much time to build everytime. May i know the reason please and what i have to do to avoid it?
friends i got the answer for my scenario:
There will be Build(if required) before launch check button was marked true. because of which it builds even if you have build it just before running. So i have unmarked it on which its running immediately.
Windows > Preferences > Run/Debug > Launching
"thousands of classes" - there's the problem.
If those are all yours, you can't help but create the .class files when they're needed.
I'd be surprised if you were touching every one of those classes. Doesn't Eclipse do incremental builds, only compiling the .java files that have changed since the last build? If not, I'd look into setting it up to do so. Maybe you could try Ant, which does do incremental builds.
make sure Project > Build automatically is checked
righ-click your project, Properties > Builders and consider removing any redunant builders. Be very careful as this might disable some desired functionality.
Do you use any external libraries as source files? This may be the problem.
If those thousands of classes are libraries you are using you should use Jars instead.

Categories

Resources