在Eclipse中附加源问题 [英] Attach Source Issue in Eclipse

查看:98
本文介绍了在Eclipse中附加源问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Eclipse(Ganymede)中,我正在调试一些使用Apache Commons HttpClient的代码,并希望进入HttpClient代码.我已经下载了源代码,并尝试以常规方式将其附加(在方法名称上按住CTRL键并单击,然后使用附加源"按钮).我尝试将其作为外部文件和外部文件夹附加都没有成功.我之前没有附加任何源代码,目前可以成功进入Hibernate源代码.

In Eclipse (Ganymede) I'm debugging some code that uses Apache Commons HttpClient and would like to step into the HttpClient code. I've downloaded the source code and tried to attach it in the normal fashion (CTRL-click on the method name and use the Attach Source button). I've tried to attach both as external file and external folder with no success. I've attached source before with no issues and can currently step into Hibernate source code successfully.

我什至尝试直接编辑.classpath文件以手动添加sourcepath.仍然没有运气.刷新项目,执行干净的构建,关闭并重新打开Eclipse并不能解决问题.令人沮丧的是,Eclipse没有提供任何错误消息.它只是不附加源.

I've even tried editing the .classpath file directly to add sourcepath manually. Still no luck. Refreshing the project, doing a clean build, closing and re-opening Eclipse do not solve the issue. Frustratingly, Eclipse provides no error message; it just does not attach the source.

以下是.claspath中的条目:

Here are the entries in .claspath:

<!-- Hibernate. Works -->
<classpathentry kind="lib" path="/myEAP/EarContent/APP-INF/lib/hibernate.jar" sourcepath="D:/Data/Download/hibernate-3.2.2.ga/hibernate-3.2/src"/>

<!-- Commons HttpClient. Will not attach -->
<classpathentry kind="lib" path="/myEAP/EarContent/APP-INF/lib/commons-httpclient.jar" sourcepath="D:/Data/Download/commons-httpclient-3.1/src/java"/>

我尝试将路径更改为D:/Data/Download/commons-httpclient-3.1/src,但这也不起作用.

I've tried changing the path to D:/Data/Download/commons-httpclient-3.1/src and that does not work either.

目录结构为:

D
  Data
    Download
      commons-httpclient-3.1
        src
          java
            org
              apache
                commons
                  httpclient
                    AutoCloseInputStream.java
                    ... (and so forth)

推荐答案

尝试将其直接指向包含顶级软件包的目录,"D:/Data/Download/commons-httpclient-3.1/src/java" .对我有用的是创建一个新的src zip文件,其中包含"org"文件夹及其下的所有内容.

Try pointing it at a directory containing the top level package directly, "D:/Data/Download/commons-httpclient-3.1/src/java" for you. What worked for me was creating a new src zip file containing the "org" folder and everything beneath it.

这是我的.classpath条目(对我有用),以防它起作用:

Here's my .classpath entry, (which works for me) in case it helps:

<classpathentry kind="lib" path="/blib/java/commons-httpclient-3.1/commons-httpclient-3.1.jar" sourcepath="/blib/java/commons-httpclient-3.1/commons-httpclient-3.1-src.zip"/>

这篇关于在Eclipse中附加源问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆