TIP: Running NetBeans target IDE on J2SE 6.0 and debugging using development IDE
Monday Jan 12, 2009
NetBeans module development (many times) involves running two IDE instances at the same time : development IDE, where actual module code is written and the target IDE where the code is executed and verified. While fixing a recent issue, I had to make the target IDE run on J2SE 6.0 and was able to debug the code, while the development IDE still running on J2SE 5.0.
This is tricky since, the target IDE by default runs with the same J2SE version as of the development IDE, there's little manual work required.
Here's what worked for me :
- Enable debugging for development IDE : Open main/nbbuild/netbeans/etc/netbeans.conf and append the following line to "netbeans_default_options".
-J-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4444
- Attach the debugger : Start the target IDE outside the development IDE, you can use the platform specific launchers inside main/nbbuild/netbeans/bin folder. (For example, on Solaris use netbeans script.) Then load the sources (open relevant module project) in the development IDE and select 'Debug/Attach debugger" from main menu. Enter the port as 4444 (as set previously, this port number should be freely available on the system and should be accessible). Then we are ready to debug the code by putting breakpoints where required and examining the variables and call stack... For more info. on debugging using NetBeans IDE, look at this FAQ.










