Menu

#114 Please be compatible with java9 modules

Backlog
accepted
nobody
None
5
2018-10-29
2018-06-25
niol
No

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>

Discussion

  • Mickael Guessant

    • status: open --> accepted
     
  • Mickael Guessant

    Trouble is we want to support Java 9 and later but still support Java 8
    => added conditional ant target to support both cases

     
  • niol

    niol - 2018-06-27

    Thanks a lot. Is it possible to migrate to another BER encoding/decoding library?

     
    • Mickael Guessant

      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.

       
  • Mickael Guessant

    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.

     
  • Mickael Guessant

    • Group: Next Release (example) --> Backlog
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.