将源附加到Eclipse的Eclipse中 [英] Attach the Source in Eclipse of a jar

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

问题描述

我在我的eclipse中添加了一个 Student.jar 到我的eclipse中的 Build Path -

I added a Student.jar into my Build Path in my eclipse like this-


右键单击项目 - > BuildPath-> Configure Build
Path-> Libraries->添加外部Jars

Right click on the project->BuildPath->Configure Build Path->Libraries->Add External Jars

Student.jar StudentTest 的类>文件。当我在eclipse中调试我的代码时,我进入 Student.jar 中的 StudentTest 类。

There is one class named StudentTest in Student.jar file. When I was debugging my code in eclipse, I stepped into that StudentTest class in the Student.jar.

之后,eclipse显示我这样 -

And after that eclipse shows me like this-


JAR文件 S:\some_location\Student.jar 没有源附件。
您可以通过点击附加来源附加源代码

The JAR file S:\some_location\Student.jar has no source attachment. You can attach the source by clicking Attach Source below

现在我不知道如何将源附加到我的蚀。从哪里?任何人都可以一步一步地提供我需要做的。

Now I am not sure how should I attach the source in my eclipse. And from where? Can anyone provide me step by step what I need to do.

更新: -
我尝试解压缩 Student.jar ,我得到学生文件夹。之后,我尝试将源指向学生文件夹但是我仍然无法正确看到该类,以便我可以正确调试该类,它显示了同样的上述行为。

Update:- I tried unzipping the Student.jar and I got Student folder. And after that I tried pointing the source to Student folder But still I am not able to see the class properly so that I can debug it properly, it shows the same above behavior.

推荐答案

.jar文件通常只包含.class文件,而不是他们编译的.java文件。这就是为什么eclipse告诉你它不知道该类的源代码。

A .jar file usually only contains the .class files, not the .java files they were compiled from. That's why eclipse is telling you it doesn't know the source code of that class.

将源附加到JAR意味着告诉eclipse源代码可以在哪里找到。当然,如果你不了解自己,这个功能就没有什么帮助。当然,您可以尝试使用谷歌搜索源代码(或检查从何处获取JAR文件的位置)。

"Attaching" the source to a JAR means telling eclipse where the source code can be found. Of course, if you don't know yourself, that feature is of little help. Of course, you could try googling for the source code (or check wherever you got the JAR file from).

这样说,您不一定需要源代码调试。

That said, you don't necessarily need the source to debug.

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

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