Eclipse / Java代码完成无法正常工作

本文翻译自:Eclipse/Java code completion not working

I've downloaded, unzipped and setup Eclipse 3.4.2 with some plugins (noteable, EPIC, Clearcase, QuantumDB, MisterQ). 我已经下载,解压缩并使用一些插件(可记录,EPIC,Clearcase,QuantumDB,MisterQ)设置Eclipse 3.4.2。

Now I find when I'm editing Java projects the code completion is not working. 现在我发现当我编辑Java项目时,代码完成无法正常工作。 If I type String. 如果我键入String. and press ctrl + space a popup shows "No Default Proposals" and the status bar at the bottom shows "No completions available". 然后按ctrl + space弹出窗口显示“No Default Proposals”,底部的状态栏显示“No completions available”。

Any ideas? 有任何想法吗?


#1楼

参考:https://stackoom.com/question/3oL3/Eclipse-Java代码完成无法正常工作


#2楼

I'm adding an answer here in case someone else finds this on Google. 我在这里添加了一个答案,以防其他人在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 来自http://mschrag.blogspot.co.nz/2009/01/open-type-cant-find-your-class.html

  • Quit Eclipse 退出Eclipse
  • Go to workspace/.metadata/.plugins/org.eclipse.jdt.core 转到workspace / .metadata / .plugins / org.eclipse.jdt.core
  • Remove *.index and savedIndexNames.txt 删除* .index和savedIndexNames.txt
  • Restart Eclipse and search Ctrl+T for the offending type. 重新启动Eclipse并搜索Ctrl + T以获取有问题的类型。 The indexes will be rebuilt. 索引将被重建。

#3楼

For those running Xfce + having IBus plugin activated, there might be keyboard shortcut conflict. 对于那些运行Xfce +并激活IBus插件的人来说,可能存在键盘快捷键冲突。

See more info on my blog: http://peter-butkovic.blogspot.de/2013/05/keyboard-shortcut-ctrlspace-caught-in.html 在我的博客上查看更多信息: http//peter-butkovic.blogspot.de/2013/05/keyboard-shortcut-ctrlspace-caught-in.html

UPDATE : 更新

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. 根据@ nhahtdh的评论建议,添加更多信息直接回答:Xfce中的IBus插件默认使用Ctrl + Space快捷键进行键盘布局切换。 To change it, go to: Options and change it to whatever else you prefer. 要更改它,请转到:选项并将其更改为您喜欢的任何其他内容。


#4楼

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. 试图按照上面不同答案中提到的步骤,我找到的解决方案与Mona建议的解决方案相同,但略有不同。 Tried to add as a comment to Mona's answer but no option was available. 试图在Mona的答案中添加评论,但没有选项可用。 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. 从存储库中获取最新的.classpath后,它工作正常。


#5楼

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! 问题解决了......神秘不是那么多!


#6楼

I had this problem and like @Marc, only on a particular class. 我遇到了这个问题,就像@Marc一样,只针对特定的类。 I discovered that I needed to designate Open With = Java Editor. 我发现我需要指定Open With = Java Editor。 As a Eclipse newbie I hadn't even realized that I was just using a plain editor. 作为一个Eclipse新手,我甚至没有意识到我只是使用普通的编辑器。

In the package explorer, right-click the file and chose "Open With". 在包资源管理器中,右键单击该文件并选择“打开方式”。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值