Java code working in Eclipse but not in Designer Client?

Hi,

I want to create a Java “Script Library”, using a code I found on the Internet, in one of my application. I can’t post this code here since it has over 2,000 lines (Encodes and decodes to and from Base64 notation).

I tried it first on my Eclipse client because I hate the Notes Designer Java editor (I’m using Notes Client 8.02 FP3) and it works flawlessly.

When I import it in a Java “Script Library” in the Notes Designer, it doesn’t compile, I receive many errors.

Here are some examples:

“as of release 1.4, ‘assert’ is a keyword, and may not be used as an identifier”

“annotations are not supported in -source 1.3”

“generics are not supported in -source 1.3”

… and many more.

Based on this Technote:

http://www-01.ibm.com/support/docview.wss?rs=463&context=SSKTMJ&dc=DB520&uid=swg21188789&loc=en_US&cs=UTF-8&lang=en&rss=ct463lotus

I found that Notes Client 8 is using JRE5 and my Eclipse is using JRE6. So I tried using the same Java code on a Notes client 8.5, which is using JRE6 based on the above Technote, but it still doesn’t work.

I don’t want to debug those 2,000 lines of code (and I’m not asking anybody to do so). I’m just wondering what’s the difference between pasting this code in Eclipse or in the Designer Client? What should be done on the Designer Client to make it work?

I might be missing something as I’m not doing lots of Java development… and those I did were very simple.

Thanks for your help.

Subject: Set to 1.4.2 for legacy purposes

You can change the JVM compile level in the notes.ini. Add the following line.

JavaCompilerTarget=1.5

That would set the compiler to 1.5. So for 8.5.1 should be 1.6.

However if you have a mixed environment (eg. R7/R6 and R8) then users not using R8.5.1 will not be able to run the code.

Subject: You’re a genius!

Hi,

I added this line to the notes.ini of my Notes Client 8.02FP3:

JavaCompilerTarget=1.5

Since then, I can compile my code without any problems.

I’m running this code on a 8.5.1 server and it works fine as well, but I didn’t have to modify the notes.ini to include that line.

Does that mean the Domino 8.5.1 server uses the Java 1.6 by default?

Thanks a lot for your help, you saved me hours if not days!