As promised to Nathan at Lotusphere, here are some quick tips for debugging your eclipse plugins in the Lotus Notes 8.x client. This first entry will assume you are using base eclipse (not using the XPD Toolkit) and remote debugging the notes client via the Eclipse PDE. So in short, this technique will work with any Eclipse derivation – Eclipse PDE, RAD, RSA, etc.
The first step is to get Notes 8.x and install it. This will be used as your plugin runtime during development.
The second step is getting your Eclipse to recognize the Notes runtime as the plugin runtime environment. This is so your plugin code can resolve the plugins from your installed Notes client. You set this under Window | Preferences menu option from the plugin development perspective:
From that screen you simply select the location of the “frameworkeclipse” directory under the notes install location.
Now we are ready to code our plugin! coding…coding…coding..
Third Step, how do we get our plugin into the notes install? Well, the only way today is to create an Eclipse feature, reference your plugin and then create an Eclipse update site. You should check the help on Eclipse org to figure that out. Once the site is created you install your plugins into your notes client using the File | Application | Install menu option to launch the Eclipse install screens. You want to walk through those screens and select “New plugins” and select the folder you exported your eclipse site to. Once the plugins are installed you are now ready to walk through your code from the Eclipse PDE!
I always launch my client with the following command line. This allows me to always attach Eclise to the notes client in case I see something strange.
C:notesframeworkrcprcplauncher.exe -console -config notes -vmargs -Duser.language=en -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8020
Notice I use the port 8020 – you will need to remember that later. You can use whatever port you want – that is the one I use.
Fourth Step, in your Eclipse PDE you need to create a new debug runtime session. Click the following menu from the debug icon in the PDE:
When you select “Debug…” you will be presented with a new dialog where you will navigate down to the “Remote Java Application” entry in the tree and select the “New Launch Configuration” from the toolbar at the top. Really, the only thing left is to make sure the port you specified in the Notes launch is the same as the one you enter here:
Once you have that you are ready to debug. This entry was to get you started with PDE/Eclipse remote debugging. Hopefully you can figure out how to set breakpoints and step through the code form here. Since your notes launches with the debug listening port, you will be able to debug the code any time.
The next entry will show you how to use the Expeditor Toolkit to debug. You can optionally just read the help, check it out here. Remember, with the remote debugging technique, you will need to export our plugins (with the exact file name) each time you make a change to your code.