Please be compatible with java9 modules
Brought to you by:
mguessan
java9 introduces modules which make some jdk apis private. For instance, com.sun.jndi.ldap which is in the module java.naming is not exported and thus not available for applications (Ber is internal proprietary API and has been removed).
The following patch works around the issue.
Maybe davmail should migrate to another BER encoding/decoding library.
--- davmail.git.orig/build.xml 2018-06-25 12:53:18.000000000 +0200 +++ davmail.git/build.xml 2018-06-25 14:45:50.902961330 +0200 @@ -88,10 +88,12 @@ <target name="compile" depends="init"> <mkdir dir="target/classes"/> - <javac srcdir="src/java" destdir="target/classes" source="1.6" target="1.6" debug="on" encoding="UTF-8" + <javac srcdir="src/java" destdir="target/classes" source="9" debug="on" encoding="UTF-8" includeantruntime="false"> + <compilerarg value="--add-exports" /> + <compilerarg value="java.naming/com.sun.jndi.ldap=ALL-UNNAMED" /> <classpath> <path refid="classpath"/> </classpath>
Trouble is we want to support Java 9 and later but still support Java 8
=> added conditional ant target to support both cases
Thanks a lot. Is it possible to migrate to another BER encoding/decoding library?
Well, the Sun classes are working fine :-)
Anyway, I also tried to move those classes under another name space, only need to move 5 classes.
What do you think about this? https://salsa.debian.org/debian/davmail/blob/master/debian/patches/embed-private-jdk-apis
Well, looks like Alexandre decided to move forward and include JNDI classes directly in DavMail tree. This may be the only practical way to handle this.