I will show how to build, register and load simple JavaAddin for Domino. I'm not entirely sure if lotus.notes.addins.JavaServerAddin is supported by HCL, so use that for your own sake.
1) Java class
import lotus.notes.addins.JavaServerAddin;
public class DemoAddin extends JavaServerAddin {
public void runNotes() {
AddInLogMessageText("Hello world", 0);
}
}
2) JAR - from project
Export/build JAR file from the DemoAddin project (we are going to put jar file in the Domino folder).
3) Register JavaAddin
Place JAR file under Domino, f.x. path could be (DemoAddin is a folder and it could be just any name, DemoAddin-1.jar is our JAR file we built earlier)
C:\IBM\Domino\DemoAddin\DemoAddin-1.jar
and then register it in server's notes.ini using variable JAVAUSERCLASSES. In case if there are other addin registered there use semicolon as a separator for Windows and a colon for Linux
JAVAUSERCLASSES=addin-1;.\DemoAddin\DemoAddin-1.jar;addin-2
Alternatively simply put JAR file into the folder \jvm\lib\ext, but personally I prefer to keep customization separately instead of mixing core JAR files with customization. Additionally I'm not sure what happens to custom JAR file when is upgradet.
4) Load JavaAddin
It's time to run our DemoAddin. From console run following command
load runjava DemoAddin
Take into account if your include your class into a package, f.x. package org.demo; than you should add that into run command
load runjava org.demo.DemoAddin
If everything went fine you should see 3 lines
RunJava: Started DemoAddin Java task.
Hello world
RunJava: Finalized DemoAddin Java task.
Possible error
If you registered JAR file incorrectly, the error could be like this. In such case just make sure you followed steps properly.
RunJava: Can't find class DemoAddin1 or lotus/notes/addins/demoaddin1/DemoAddin1 in the classpath. Class names are case-sensitive.
If I find time, I will make few more posts about this topic. It's really just a tip of the iceberg.
All articles in series