现在的位置: 首页 > 综合 > 正文

无法在Eclipse查看class源文件一个的解决方法

2013年10月12日 ⁄ 综合 ⁄ 共 1443字 ⁄ 字号 评论关闭

问题描述:使用Eclipse进行插件开发一段时间后,突然某天无法查看GEF class的源文件。本人未找到本问题的根因,知道的朋友,请指点

参考下面方法解决

For eclipse users who are debugging the following message might be familiar:

The JAR of this class file belongs to container ‘Plug-in Dependencies’ which does not allow modifications to source attachments on its entries.

This always happens when Eclipse cannot find the source code for a plugin bundle which is part of your target platform but the target platform does not contain a accordant source bundle. This for example happend to me today with the embedded Jetty (org.mortbay.jetty_5.1.14.v200806031611.jar)
inside the Eclipse Equinox OSGI platform which makes up my target
platform.

When debugged and wanted to go into any class inside a jetty package I always got the message that it is a class from Plugin-Dependencies and the source attachment cannot be modified.

I solved it like this:

  1. Switch to the Plugins View in Eclipse ( Window / Show View / Plugins)
  2. locate the bundle org.mortbay.jetty
  3. right click on that bundle and select “Import as” -> “Binary Project with linked content”

Now that Bundle shows up in your Package Explorer as a new Eclipse project, in my caseorg.mortbay.jetty.

Now right click on that new project in the package explorer and goto ‘Properties / Java Build Path / Libraries’. You see the the jetty jar file there and if you expand this entry you can edit the ‘Source Attachment’ as usual. I pointed it to the downloaded
Jetty Source code located in a completely different folder than my target platform which I am using for my project.

转载地址:http://blog.keksrolle.de/2011/01/09/how-to-add-source-attachments-to-jar-files-from-eclipse-target-platform-plug-in-dependencies.html

抱歉!评论已关闭.