Domino Designer is essentially an IDE. The following example shows how HelloWorld looks in Domino.
import lotus.domino.*;
public class HelloWorld extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
System.out.println ("Hello world!");
} catch(Exception e) {
e.printStackTrace();
}
}
}
In this example, you might notice the following items:
- Domino Designer has included an import statement to include its domino classes and object model. These Domino classes essentially map out to equivalent classes in Lotus script.
- The default class name for a new Java agent is JavaAgent. In this case, we have changed it to HelloWorld. After the agent is saved, it is included in the Domino Database that has HelloWorld.java, and is suitable for export if necessary.
- The standard agent or application entry point is NotesMain
- Domino Designer inserts two lines of code to establish a Notes session to run the agent.
- A catch statement is automatically inserted to catch any errors reported to the JVM.
In the Domino Designer, our example is displayed in the agent window as shown in the following figure.

In addition to using Java in notes agents, Java can also be included in a Domino Database as a Java Library. This give added flexibility in developing shared codes and applets.