logo

Using The Latest Java Versions in Domino Agents

The other week I figured out how to make Domino Designer let me code using more up-to-date versions of Java.

I was trying to use a third-party API. To use the API required coding with a version of Java, which, although I knew my version of Domino supported, was giving me compilation errors nonetheless.

As an example, create a new Domino "app" in Designer 8.5 and add a new Java Agent. Try to add a parameterized type, as below:

image

Hovering over the error it says:

"Syntax error, parameterized types are only available if source level is 1.5"

A quick Google confirms that Domino 8.5 supports Java 1.6. So why won't the above code work?

It turns out you need to change the Java compilation settings on a per-database basis.

If you go to the Project -> Properties menu from within the database in Domino Designer and find the Java Compiler tab, you'll see something like this:

image

Change both of the above settings so that all say "1.5" and then the code compiles without any errors:

image

Note: It's my assumption and I guess it goes without saying that this means any Java Agents written in the this database will only run on Domino server that support Java 1.5. I guess the reason it defaults to Java 1.2 for the .class files is to extend compatibility as far back as possible?

But version of Domino added support for Java 1.5? Glad you asked. Read on.

A Brief History

Here's a short history of Java versions released and which version of Domino added support for that version of Java.

Java Version Domino Support Notes
Version Date Version Date  
JDK 1.0 Jan 1996 - -  
JDK 1.1 Feb 1997 4.5 Dec 1996  
J2SE 1.2 Dec 1998 - -  
J2SE 1.3 May 2000 6.0, 6.5 Sep 2002  
J2SE 1.4 Feb 2002 7.0 Aug 2005  
J2SE 5.0 (1.5) Sep 2004 8.0 Aug 2007 Adds enumerations, better for-each looping as well as generics
Java SE 6.0 (1.6) Dec 2006 8.5 Dec 2008  
Java SE 7 July 2011 - -  

As you can see there's typically a 2 to 3 year delay between a new Java version coming out and a version of Domino adding support for it.

To me the most significant change in Java came in version 1.5 (Domino 8.0) when you could use not only generics but also enumerations and easier looping, like this:

image

All in it offers a more pleasant (C#-like) programming experience. Next time you write a Java agent consider switching to using Java 1.5!!

Most of the above will probably seem plainly obvious to most seasons Domino devs, but it was news to me. Hopefully this will help others in my shoes.

References

Java Support in Domino

Java Release Dates

Lotus Notes Release Dates

Comments

    • avatar
    • Rami
    • Mon 10 Oct 2011 07:56 AM

    Is Java like C# coding or is C# more like Java coding?

    Anyhow, it's great when they share (copy) ideas from each others :)

    • avatar
    • Chris C
    • Mon 10 Oct 2011 04:26 PM

    I've been trying to use Java instead of LotusScript to write agents for a few months now. It is such a better language and it has tons of great libraries for stuff like working with PDFs and Excel files. Getting experience in Java translates better when switching to different technologies in the future, while LotusScript looks like a dead end outside of Domino (it even seems like a dead end within Domino since they haven't been extending it and adding any new features). Have you tried the hack yet that allows you to use the Eclipse debugger within Designer?

      • avatar
      • Jake Howlett
      • Tue 11 Oct 2011 03:29 AM

      Which hack is that?

      Hide the rest of this thread

        • avatar
        • Chris C
        • Tue 11 Oct 2011 02:41 PM
  1. Hi,

    do you know if Java SE 7 is supported by 9.0?

    Thanks

      • avatar
      • Phil Warner
      • Thu 10 Oct 2013 04:05 AM

      By default, you can only set it to compile up to Java 6. There may be a way to install Java 7. You'd need to have that on the server too. I haven't found a way to do it.

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Mon 10 Oct 2011

Share This Page

# ( ) '

Comments

The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

More Content