Do I need to restart NetBeans every time to debug new changes?

Apache NetBeans Wiki Index

Note: These pages are being reviewed.

Q: I am going to develop something on the NetBeans platform, and the question is - do I need to restart NetBeans every time to debug new changes?

For example, I want to enhance the Search dialog. I have built the utilities module (containing SearchPane) using Ant - what is next?

A: You have several options:

  1. Debug Project from the (development) IDE. After making changes - within a method body only! - use Apply Code Changes from the IDE, and they should take effect immediately in the target platform.

  2. Run Project (no need for the debugger). After making changes to code, shut down the platform and Run Project again - the module will be rebuilt and the platform started with your changes in effect.

  3. Run Project. After making changes, select Reload in Target Platform from the project’s context menu in the IDE. This will try to disable the module and reenable the new version. Only works for regular modules (not autoload or eager), and will likely cause mayhem if a lot of other modules depend on this one, so not always feasible.

  4. Install Javeleon in the development IDE. Then use the steps from #3, with the advantages that autoload and eager modules are supported (as of NB 7.2 only), modules with many incoming dependencies work fine, and (like #1 but without its restrictions) any running state is preserved.

  5. Do not run the project; just select Reload in Development IDE from the context menu. Similar to #3 but reloads inside the current IDE, not in a separate target platform.

Procedure #2 is safest. #1 is fine for minor tweaks. #4 basically supersedes #3 if you do not mind using an added tool, and is most convenient when you are making a lot of nontrivial changes in rapid succession. #5 is not recommended except for demos.