try restoring the default options in '
windows > preferences > java > editor > content assist > advanced'
an example of the kind of data you see in this preference screen, however not necessarily what you currently have.
(from vadim in this blog post " content assist duplicates in eclipse (mylyn)":
if have duplicate mylyn entries, uncheck the duplicate entries that do not contain "
(mylyn)" in their name)
the eclipse help page defines the default list to restore:
select the proposal kinds contained in the 'default' content assist list:
- other java proposals,
- swt template proposals,
- template proposals,
- type proposals
for me in sep 2021 it was an odd eclipse bug. i had a multi-line string inside an annotation in my class. this caused just that particular class to fail when trying to code complete (even though the class compiled just fine).
for me the issue was a conflict between several versions of the same library. the eclipse assist was using an older version than maven.
i had to go to the .m2 directory and delete the unwanted lib version + restart eclipse.
i experience problems on eclipse neon when editing a file which does not belong to the project directory. when i copy the same file to the project root directory, not even to the src directory, the completion starts working.
when the file is opened from a different directory, only completion for jre works. that is for example:
java. completes, but
junit. does not.
just in case anyone got to a desperate point where nothing works... it happened to us that the content assist somehow shrunk so no suggestion was shown, just the "press ctrl+space for non-java..." could be seen. so, it was just a matter of dragging the corner of the content assist to enlarge the pop-up.
i know, embarrassing. hope it helps.
note: this was an ubuntu server with xfce4 using eclipse oxygen.
if you're experiencing this in an enum, or when initializing an array with anonymous classes, it's a known bug in eclipse. see eclipse content assist not working in enum constant parameter list.
in my case, intellisense had only disappeared in a few classes in one project. it turned out this was because of a missing library on the build path (although it worked previously).
so definitely check all the errors or problems in eclipse and try to find if a library may be missing
i ran into this and it ended up being i was opening the file with the text editor and not the java editor.
for those who use the latest 3-19 eclipse build:
it just happened to me when upgrading from oxygen to 3-19 eclipse version, so i assume the auto-complete feature does not migrated correctly during the upgrade process.
the only solution that worked for me was to create a new eclipse workspace, and import the project/s to it. it might take a few minutes, but it worth it - comparing to the time spent on other solutions...
maybe this helps other people who come across the same issue.
my setup: old gradle project (version gradle 2.12) made by someone else, imported using the gradle import wizard into sts (eclipse oxygen.2 (4.7.2)).
code completion did not work either (and i still have hollow js at the java files), but at least i got the code completion to work by doing:
- right click on the project folder > properties > gradle > configure workspace settings > java > editor > content assist > advanced
- check "java proposals in upper window.
- 2x apply & close
i have run into this problem since upgrading to eclipse 2019-09. based on some of the suggestions above, this is what worked for me.
i had to go to eclipse -> preferences -> java -> editor -> content assist -> advanced.
i found out that if i turn on any of the key binding proposals, java non-type, java, java (task-focused) or java type proposal, then i was able to use auto complete. if i turned them all on, then not only did auto complete work, but i got duplicate methods listed. i am guessing, but i will probably used java type proposals. any clarification of what differs for these four types would be appreciated.
i faced this problem, and spent hours trying to figure out the issue. tried to follow the steps mentioned in the different answers above, the solution i found is on the same lines as mona suggested, but slightly different. tried to add as a comment to mona's answer but no option was available. issue with my eclipse was, classpath somehow got corrupted and all the jars and dependent projects were missing. after taking the latest .classpath from repository it worked fine.
check that you did not filter out many options inside the window > preferences > java > appearance > type filters
items in this list will not be appear in quick fix, be autocompleted, or appear in other various places like the open type dialog.
i also face this issue but it is resolved in different way. steps that i follow may be helpful for others.
- right click on project (the one you are working on)
- go to properties > java build path > jre system library
- click edit... on the right
- choose the jre 7
once you have you configuration checked and completion is still not working:
- make sure you have the right directory structure.
do you see the right icon beside the file?:
it will tell you how the file will be treated by eclipse:
i am posting this answer as i had that story with with maven webapp artifact. by default maven-webapp does not create folder for sources and i put my java into resources, wondering for 5 minutes what was going on... :)
if you have installed google toolbar for ie, may be you can face the same problem. because, the toolbar capture the shortcut ctrl+space.
i had this problem and like @marc, only on a particular class. i discovered that i needed to designate open with = java editor. as a eclipse newbie i hadn't even realized that i was just using a plain text editor.
in the package explorer, right-click the file and chose "open with".
none of these worked for me.
i was experiencing this issue in only once particular class. what finally worked for me was to delete the offending class and recreate it. problem solved... mystery not so much!
another solution which worked for me is to go to java--> appearence --> type filters and do disable all
check the lib of your project. it may be that you have include two such jar files in which same class is available or say one class in code can be refrenced in two jar files. in such case also eclipse stops assisting code as it is totally confused.
better way to check this is go to the file where assist is not working and comment all imports there, than add imports one by one and check at each import if code-assist is working or not.you can easily find the class with duplicate refrences.
for those running xfce + having ibus plugin activated, there might be keyboard shortcut conflict.
see more info on my blog: http://peter-butkovic.blogspot.de/2013/05/keyboard-shortcut-ctrlspace-caught-in.html
as suggested by @nhahtdh's comment, adding the some more info to answer directly: ibus plugin in xfce uses by default ctrl+space shortcut for keyboard layout switching. to change it, go to: options and change it to whatever else you prefer.
i'm adding an answer here in case someone else finds this on google. same symptoms; different problem. for me, the type caches had become corrupt.
- quit eclipse
- go to workspace/.metadata/.plugins/org.eclipse.jdt.core
- remove *.index and savedindexnames.txt
- restart eclipse and search ctrl+t for the offending type. the indexes will be rebuilt.
- Eclipse Kepler - PHP Code completion not working
- Eclipse code fomatter not working for Java Generics code?
- Eclipse Kepler Code completion not working
- Eclipse Oxygen Java Code Completion Not Working?
- Eclipse 4.6 code completion does not work with Java 9
- Eclipse Maven - Code Completion fails "This compilation unit is not on the build path of a Java project" and "Failed to Download Index" Error
- Running a Java code in cmd is not working while everything is fine in Eclipse
- Eclipse Java Project: "Source not found" complaint in working code
- Eclipse/Java code completion not working
- I get "Source not found" when debugging my Java code in Eclipse
- Eclipse autocomplete not working in some Java files
- Why does Eclipse code completion not work on some projects?
- 'Hot code replace' not working -- Eclipse doesn't change any code on JBoss
- Eclipse Java Content Assist not working
- apache tomcat 9.x not working with eclipse & Java 10.0.1
- Eclipse 2021-09 code completion not showing all methods and classes
- Ant not working in Eclipse Kepler (Java Virtual Machine Launcher - A Java Exception has occured)
- eclipse not working - No java virtual machine was found
- Is it possible to mark a part of java code in eclipse to be not auto formatted?
- Java source code not shown in Eclipse debug view
- Eclipse debugger does not recognize new java code
- What do these numbers `10k`, `6k`, `1k`, `210` in java eclipse code completion mean?
- how come Eclipse compiles this Java code but not Ant?
- java application not working with java9 and eclipse
- Code Completion not working with remote file (with RSE)
- Eclipse Java 11 classpath only not working compared to Maven
- How to make code completion for Java 8 lambda parameters in Eclipse work?
- Java CRTP and Wildcards: Code compiles in Eclipse but not `javac`
- Eclipse CDT C/C++ code completion problem in NDK / Java project
- Eclipse content assist not working for Java objects within Groovy files
More Query from same tag
- Determine signing certificate from an APK
- Where are Eclipse key configurations saved on Mac OS X
- Android Activity Not found - never had before this error
- Not possible to analyze locally in SonarQube
- GWT can't define canvas on existing element
- Cannot deploy Web application to tomcat from Eclipse
- Unable to debug simple Java application in Eclipse. Cannot connect to VM. AGENT_ERROR_TRANSPORT_INIT(197)
- How to Ctrl+Shift+Space shortcut shows method help on eclipse?
- Permission denied when accessing local PHP web service from Android app project
- How to enable Ant development in Eclipse
- ’unresolved import’ message for streamlit in Eclipse PyDev
- Key binding for Eclipse commands
- Eclipse performance tuning for multiple CPUs and lots of memory?
- No window comes up when running javafx application
- Image Upload using intent
- How can I view Java 10 Javadocs (in Eclipse)
- Android Eclipse Debugging: Getting Intermediate Values
- Difference between Ctrl+Shift+F and Ctrl+I in Eclipse
- Negative array size exception thrown by Eclipse
- Setting environment variables on eclipse
- Hibernate error , unable to create SessionFactory
- Eclipse: Can a single JAR have more than one JavaDoc location attached?
- Is there a setting to prevent Eclipse's formatter from inlining statements declared as blocks?
- generated apk appears corrupted
- Java generics code compiles in eclipse but not in command line
- Meaning of Eclipse Icon Adornment
- Turn off airplane mode [A continued question]
- Specifying minor version in JDK Compliance eclipse
- How does Eclipse web service explorer work?
- Centralize Eclipse Configuration