views:

70

answers:

2

Hi,

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.

A: 

Perhaps this reply helps you even though it is about Eclipse? http://stackoverflow.com/questions/1732259/eclipse-how-to-debug-a-java-program-as-a-jar-file/1732316#1732316

simgron
From what I can see this is not an option with netbeans
steve
I rather meant it as an example from which you extract useful hints and ideas. What I understand NetBeans does have similar options but I have not used NB in a very long time.
simgron
+1  A: 

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
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
You don't need to abandon Netbeans, it seems there is a plugin for maven http://maven.apache.org/netbeans-module.htmlYou 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
Thanks, will take a look
steve