java - 了解 Eclipse 编辑器中的注释

标签 java eclipse markers

我正在尝试从此站点学习 Eclipse 编辑器注释:

http://www.ibm.com/developerworks/opensource/tutorials/os-eclipse-plugin-guide

这似乎是一个非常好的教程,但是我复制到 Eclipse 工作区的任何代码,它总是显示错误“一行中有多个标记”

例如,当我复制以下代码时:

public static IMarker createMarker(IResource res)
throws CoreException {
       IMarker marker = null;
       //note: you use the id that is defined in your plugin.xml
       marker = res.createMarker("com.ibm.mymarkers.mymarker");
       marker.setAttribute("description," "this is one of my markers");
       //note: you can also use attributes from your supertype
       marker.setAttribute(IMarker.MESSAGE, "My Marker");
       return marker;
}

我会得到一行中有多个标记的错误。你能帮我问一下吗?我对此感到非常沮丧,并且已经花了 2 个小时。

最佳答案

多个标记表示指定的行有多个错误。 我假设错误在这一行:

marker.setAttribute("description," "this is one of my markers");

请注意,放错位置的逗号 (,) 更正后的版本应为:

marker.setAttribute("description", "this is one of my markers");

尝试一下并进行干净的构建。我确信这次一定会成功。

关于java - 了解 Eclipse 编辑器中的注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25118213/

相关文章:

java - WindowBuilder 中的超大 JPanel

java - 每次打开两个eclipse实例

python - 如何获取matplotlib中所有标记的列表?

java - Eclipse 中的多个标记错误

java - 避免连接主动/被动 ActiveMQ 时出现错误消息

java - 分布式系统应该使用哪些Appender?如何配置它们?

java - Facebook : posting same status to user wall getting error

java - Android 应用程序部署在 Eclipse 上创建重复项

popup - OpenLayers(OSM)中触发功能弹出窗口的正确方法是什么?

JAVA FX - 隐藏阶段丢失的服务任务响应