Thursday, January 03, 2008

Profiling Maven 2 Apps in Netbeans 6

I thought this might be more complicated. It wasn't. To use the Netbeans profiler with your Maven 2 project you simply need to add a single pair of parameters when running your java app. Call up the project's Properties dialogue, select the "Run" tab and add something like the following to the jvm args:

-agentpath:"C:\Program Files\NetBeans 6.0\profiler2\lib\deployed\jdk15\windows\profilerinterface.dll=\"C:\\\"Program Files\"\\\"NetBeans 6.0\"\\profiler2\\lib\\"",5140

This meant that now when I ran my app (F6) execution would wait for me to attach the profiler. Cue real time graphy goodness. Sweet.


Anonymous said...


calyen said...

Thanks for the tip,
Can you elaborate how to set this option ?

Is it in the Actions tab of maven project properties ?

I'm using ubuntu, is this the right config line ?



Andrew Law said...

Hi caylen. Nearly. You're right its the maven project properties dialog (right click the maven project > Project Properties) Then select the "Run" category.


Michael said...

Good one - thanks.

Also, it's useful to save that as a custom config in the properties then you can easily switch between profiled and default Run args

Varun said...


My name is Varun Nischal and I'm the NetBeans Community Docs Contribution Coordinator. Your blog entry would make a fantastic tips and Tricks for our Community Docs wiki (

Would you be willing to contribute it? If you need any help or have any questions, please contact me at

I look forward to hearing from you.

Varun Nischal
"You must do the things you think you cannot do."