4

I'm using some apache libraries in my code. At the moment I'm hitting a variety of problems that I need to debug. However the problem is when I pass data into one of said Apache libraries, when I try to step into the method call using netbeans it simply does the processing in the background and doesn't step into the code I want to view.

Does anyone know how I configure the IDE so that I can debug the apache code as well? Right now I just associate the JAR's with the project by adding them as libraries.

Steve
  • 21,163
  • 21
  • 69
  • 92

1 Answers1

3

You need to attach a source jar (e.g. commons-lang-2.4-sources.jar) to your dependency, instructions here

I should also recommend using Maven2 to manage your project dependencies, I've not used Netbeans for at least 5 years, but both Eclipse & IntelliJ have Maven plugins which will import all your dependencies and link them to sources/javadoc jars automatically.

Jon Freedman
  • 9,469
  • 4
  • 39
  • 58
  • The apache jars I'm using are generated from a maven project. I've now looked at trying eclipse / intelij with the project. Once I open the maven project, do I need to create maven commands so that I can run my code? – Steve Aug 18 '10 at 13:31
  • 1
    You don't need to abandon Netbeans, it seems there is a plugin for maven http://maven.apache.org/netbeans-module.html You can use maven to manage your dependencies, and build your project jar files, but you still need to execute your code in the same way. See maven getting started guide http://maven.apache.org/guides/getting-started/index.html and if you have a spare 45min watch this podcast by John Smart the author of Java Powertools (recommended) http://skillsmatter.com/podcast/java-jee/zen-and-the-art-of-build-script-maintenance – Jon Freedman Aug 18 '10 at 13:37
  • @JonFreedman my scenario is a bit different, I have a web app referencing a jar file, which I have its source in the project , is there a way to link the source of the jar file to the project within IDE ? – zinking Jul 16 '14 at 06:29