I am trying to compile the Java Agent in Eclipse … I have read, that every agent in Java under Lotus has to have a LotusMain method, as a starting point of program execution. The problem is, that if I try to compile this code under Eclipse, I receive error, that my class do not have a MAIN method:
I think, you can’t compile a Notes Agent this way.A Notes Agent is only runnable inside Lotus Notes, not inside Eclipse and not as java standalone programm.
I think, Eclipse tries to compile it as standalone program, and a java standalone progam needs a public static void main method.
I use IntelliJ IDEA to write my Notes Agents, but don’t compile them there, but copy the source code into the Lotus Designer.
Actually, there is not a problem ;o) Yes, it is possible to compile Notes Agents in Eclipse … Even if the Eclipse says, that the main function is missing, the source is compiled successfully!
The biggest advantage for me is, that I can remotelly debug applications with Eclipse. I can see the variables, placing break points atc …
This is something Lotus Notes can not do, or not very good …
The default “entry point” for a Notes agent is the NotesMain() method after an instance of the “base” class has been constructed. The default entry point for a standalone Java program is the main() method with a signature as follows:public static void main(String args) {
// code goes here
}
Your class can definitely extend AgentBase and run without problem in Eclipse (or other IDEs) as a stand-alone.