Eclipse Java 内容辅助不工作

标签 eclipse

Eclipse 3.4 和 3.5 中的内容辅助已停止为我工作。当我输入类的前几个字符并点击 CRTL-space 时,经过一段延迟后,我收到以下错误消息 alt text http://locuslive.com/webdrive/JDTscreenshot.png

无论我启用/禁用什么提案,我都会收到此(或类似)消息。

我已经尝试过:

  • 更改 Xms/Xmx 值

  • 使用 -clean 启动 Eclipse

  • 创建新工作区并导入我的项目

但是这些都不起作用。

我看到一些帖子暗示其他应用程序可能正在接管 CRTL 空间或以其他方式进行干扰,但是除了运行新的 Eclipse 之外我什么也没有,问题仍然存在。

我的问题与 this post 中提到的问题非常相似尽管是在更高版本和 OSX 10.5.7 上。

有人对如何解决这个问题有任何建议吗?

谢谢。

更新:对于任何感兴趣的人,我通过使用 Eclipse 3.5 Classic(即不包括 Mylyn)获得了最好的结果。我还使用了下面 VonC 链接到的错误报告中指定的设置。

有趣的是,经典并没有一些 View ,例如。片段,但这些很容易从另一个发行版中放入。

更新2:即使使用最新版本的Eclipse(3.6 M1),这个问题实际上仍然存在。这是由我的 Altova Mapforce 生成的一个大型 JAR 文件引起的,该文件用于处理我们应用程序中的 EDIFACT 转换。通过将此 JAR 添加到构建路径即可重现,并且无需更改内容辅助设置帮助。该错误(和 JAR)可以在 https://bugs.eclipse.org/bugs/show_bug.cgi?id=289057 中看到。

最佳答案

the Mylyn FAQ确实提到:

Why do I get an error message when using content assist?

如果在调用内容辅助后您看到一个错误消息对话框,其中指出:

 The extension took too long to return from the 'computeCompletionProposals()' operation

http://wiki.eclipse.org/images/0/0a/Mylyn-content-assist-timeout.gif

这很可能由于某些因素中断了提案操作(例如垃圾收集)。如果它不再重复,请忽略它,如果重复,请增加 Eclipse 的内存(例如通过 -Xmx384M 命令行参数)。请参阅bug 141457了解更多详情。

Note that Mylyn should only add a trivial amount of overhead to content assist computation, however, the standard content assist mechanism will not report timeouts of this sort (i.e. taking longer than 5s to compute proposals).
If the system that you are working on is so large that increasing memory does not reduce the timings to avoid the message, you could also consider disabling the Mylyn-specific content assist, as described above, but if doing so please comment on bug 141457.

<小时/>

您可以在此 SO answer 中找到良好的 Eclipse 设置.
由于您已经尝试增加内存,因此您可以对错误 141457 发表评论。

这可能与 bug 281871 有关,仅在 eclipse 3.5.1 和 3.6 中修复。

I see it now. The problem is that code assist starts to use the Java model if the index is not yet up to date.

You can either wait until the indexer is done or increase the timeout by setting the 'org.eclipse.jdt.ui.codeAssistTimeout' Java environment variable when starting Eclipse, e.g.

 -vmargs -Dorg.eclipse.jdt.ui.codeAssistTimeout=60000

关于Eclipse Java 内容辅助不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1367306/

相关文章:

java - 由于删除了 java.orig 文件,tomcat 无法发布

java - 我们可以在eclipse中从我们的项目中调用另一个项目java类吗

java.lang.IllegalArgumentException : plexus.container.default:无效的模块名称: 'default'不是Java标识符

eclipse - 使用 CFBuilder 插件时堆栈溢出

php - 在 Eclipse 中下载 SVN 的 SQL 架构

java - Eclipse 在服务器上调试/运行

Eclipse 无法将所有依赖项部署到 Tomcat

java - 类 'Lcom/google/android/gms/gcm/GcmReceiver;' 的链接失败

java - 更新 Gradle 项目库

python - 从 Python (ctypes) 调试 C 库