
I’m playing around with Notes 8 to get my bearings on the Gold release and I’m liking it. I’m kind of a Java-nut so I wanted to see if Lotus delivered on their promises to include Java 5 in Notes 8 and they did. Unfortunately the Java API hasn’t been updated for this release but hopefully this will happen in the near future. I know I will certainly stress that it will in the Domino Application Development Design Partner program where I have been fortunately enough to be included (together with Nathan and a fine line of other fine folks).
To test it out I fired up Domino Designer and created an agent to use generics and some autoboxing. Both are highly awaited in the Notes Java world – at least by me – and it will be really nice to have. The test agent code is as follows (generics and autoboxing is highlighted):
import lotus.domino.*;
import java.util.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
int size = new Integer(10);
List<Document> docs = new ArrayList<Document>(size);
for (Document d : docs) {
d.getUniversalID();
}
} catch(Exception e) {
e.printStackTrace();
}
}
}
To my surprise the above code didn’t compile and gave me the below compile error message.
I tried compiling the same code in Eclipse (using Java 5 source compatibility) and importing the class file as an Imported Java agent which worked fine. Hmmm – binary support but no source support? Last resort – look for clues in the release notes and there you have it! In the section “Installation, migration, upgrade, and configuration informationUpgrade notesNotes/Domino 8 upgrade to JDK (Java Development Kit) 1.5” it states that in order to keep backwards compatibility Java 5 source compilation in Domino Designer is disabled out of the box. To enable it add the following notes.ini variable and restart Notes:
JavaCompilerTarget=1.5
Once this line has been added I was able to compile the above code… ๐