Java / NetBeans - 如何进入一个jar文件? [英] Java / NetBeans - How to Step into a jar file?

查看:199
本文介绍了Java / NetBeans - 如何进入一个jar文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Netbeans中有一个Java项目,它的库部分属性中列出了几个jar文件。



我发现了一个jar文件中的错误,我想



以下是我迄今为止所做的:


    我已经找到
    jar文件的源代码。
  1. 我将这个源作为一个项目打开
    NetBeans(它以NetBeans
    项目)

  2. 我从
    项目的
    编译时库部分删除了该jar文件。

  3. 我使用add project在
    项目的
    编译时库中添加了新项目。

  4. 在新的
    项目和我的项目。

它像以前一样构建和运行,但我仍然无法进入新项目的代码。但是当我尝试在新项目中进入一个方法时,Netbeans说无法打开(缺少源代码))。我还试图在新项目的方法中设置一个断点,但是Netbeans表示无法提交断点LineBreakpoint ObjectMakerFactory.java:203,原因:类中没有可执行位置203

解决方案

我不能说netbeans,但对于Eclipse和IntelliJ,我一直都有成功下载src jar并将其添加到项目中。然后,在我的代码中,当我点击jar中的类的方法,IDE将我带到源。如果发生这种情况,您可以在src中设置断点并正常进行。


I have a Java project in Netbeans with several jar files listed in its library section of properties.

I found a bug in one of the jar files and I want to step into it while debugging.

Here's what I've done so far:

  1. I've found the source code for the jar file.
  2. I opened that source as a project in NetBeans (it comes as a NetBeans project)
  3. I deleted that jar file from the compile-time libraries section of my project.
  4. I added the new project in the compile-time libraries section of my project using "add project".
  5. Did a clean and build on the new project, and on my project.

It builds and runs the same as before but I still can't step into the new project's code. But when I try to step into a method in the new project Netbeans says "cannot open (missing source?)". I also tried to set a breakpoint in the new project's method but Netbeans says "Not able to submit breakpoint LineBreakpoint ObjectMakerFactory.java : 203, reason: No executable location available at line 203 in class ...."

解决方案

I cant say for netbeans, but for Eclipse and IntelliJ I've always had success downloading the src jar and adding it to the project. Then, in my code when I click into the method for a class in the jar the IDE brings me to the source. If that is happening, you can set breakpoints in the src and proceed as normal.

这篇关于Java / NetBeans - 如何进入一个jar文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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