How to launch an NSF from Eclipse Java

I was asked this question the other day from a business partner and thought there are a couple of ways to skin this cat.  You can launch a program from pure Java using the Runtime class.  On windows (which meand this is really a poor solution) the command would look something like this:

Runtime.getRuntime().exec( “rundll32 url.dll,FileProtocolHandler ” + notesURL );

Where notesURL would be something that looks like this:  “Notes:///852568BD0051EF1E/6AE46DA7E9B0F3C185257297005D6B2D/B43A4DC7CB1E82AF852575C300626805”

If you want to use a more basic approach, Eclipse has the Program class that allows you to launch an application.  By simply passing in the URL as the program the operating system will pass it on to the correct handler (much easier and cross platform aware).

import org.eclipse.swt.program.Program;


Lastly, in Notes 8.5.1 there will be a new Java UI API (but don’t hold my word to this) to launch databases and views with a single call.  It is similar to the LotusScript package.  This is available to business partners and anyone who has access to the Notes 8.5.1 code.  So if you have a direct need to use Notes API’s then this will work, otherwise I recommend using the SWT Program class.

NotesUIWorkspace ws = new NotesUIWorkspace();
ws.openDatabase( );


One thought on “How to launch an NSF from Eclipse Java

  1. Sorry if this is a bit off topic, but I have been searching for a way to communicate with a local notes database through a java sidebar application in lotus notes. I have been searching around, but I have yet to find a functional tutorial. Is there anything you could recommend?




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s