gpt4 book ai didi

java - 在 jar 的 Eclipse 中附加源代码

转载 作者:IT老高 更新时间:2023-10-28 20:46:38 26 4
gpt4 key购买 nike

我像这样在我的 Eclipse 中的 Build Path 中添加了一个 Student.jar -

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

Student.jar 文件中有一个名为StudentTest 的类。当我在eclipse中调试我的代码时,我进入了Student.jar中的那个StudentTest类。

在那次 eclipse 之后让我看到这样-

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

现在我不确定我应该如何在我的 Eclipse 中附加源代码。又从哪里来?谁能一步一步告诉我我需要做什么。

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

最佳答案

使用 Java Source Attacher !

它做了 eclipse 应该做的事情——一个右键单击上下文菜单,上面写着“附加 Java 源代码”。

enter image description here

它会自动为您下载源代码并将其附加。我只访问了几个它不知道的库,当发生这种情况时,它可以让您将 url 回馈给社区,这样其他人就不会对该库有任何问题。

关于java - 在 jar 的 Eclipse 中附加源代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15180411/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com