Eclipse/Java code completion not working

2019-01-01 09:35发布

I've downloaded, unzipped and setup Eclipse 3.4.2 with some plugins (noteable, EPIC, Clearcase, QuantumDB, MisterQ).

Now I find when I'm editing Java projects the code completion is not working. If I type String. and press ctrl+space a popup shows "No Default Proposals" and the status bar at the bottom shows "No completions available".

Any ideas?

标签: java eclipse ide
19条回答
孤独总比滥情好
2楼-- · 2019-01-01 10:13

I ran into this and it ended up being I was opening the file with the text editor and not the java editor.

I wanted to comment on https://stackoverflow.com/users/607470/elroy-flynn response but the add comment only works after I have a rating of 50? not sure WTF that is...

Thanks, Tom

查看更多
若你有天会懂
3楼-- · 2019-01-01 10:13

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
查看更多
流年柔荑漫光年
4楼-- · 2019-01-01 10:15

Another solution which worked for me is to go to Java--> Appearence --> Type Filters and do disable allenter image description here

查看更多
谁念西风独自凉
5楼-- · 2019-01-01 10:15

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.

查看更多
刘海飞了
6楼-- · 2019-01-01 10:16

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.

From http://mschrag.blogspot.co.nz/2009/01/open-type-cant-find-your-class.html

  • 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.
查看更多
梦该遗忘
7楼-- · 2019-01-01 10:16

If you have installed Google Toolbar for IE, may be you can face the same problem. Because, the toolbar capture the shortcut ctrl+Space.

查看更多
登录 后发表回答