Menu

#783 Sweethome3d fails to build from source with OpenJDK 9

v_5.x
open
None
1
2018-03-12
2017-09-17
No

Hello,

currently Sweethome3d fails to build from source with OpenJDK 9 due to some changes in generics of certain Swing classes. For instance:

Build log:
[javac] /build/sweethome3d-5.4+dfsg/src/com/eteks/sweethome3d/swing/FileContentManager.java:1132: error: incompatible types: Vector<file> cannot be converted to Vector<treenode>
[javac] this.children = new Vector<file>(childDirectories.length); </file></treenode></file>

At some point in time OpenJDK 9 will be the default JDK/JRE for Debian and many other Linux distributions. It would be nice if Java9 was supported.

Debian-Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=873224

Discussion

  • Emmanuel Puybaret

    Thanks for the information. I shall have a look to this issue in the future.
    Following recent changes in Java is necessary, but keep in mind that maintaining compatibility of Sweet Home 3D at least with Java 6 (the biggest Java version available under Mac OS X 10.6 still often used) is important too.
    Java 5 (the biggest Java version available under Mac OS X 10.4 - 10.5) is used only by very few people so, at least we could update the -target 1.5 used for javac to -target 1.6, the first change required by Java 9 compiler, without big problems (Mac OS X 10.4 - 10.5 users can still upgrade to 10.6 if needed without losing Roseta).
    But maybe Sweet Home 3D can be compiled with Java 8 and still run under Java 9 during a long time, no? Did you try it?

     
  • Markus Koschany

    Markus Koschany - 2017-09-18

    Unfortunately we (Debian) don't support this use case. We can support only one JDK per release. That means all software must be able to build and run with OpenJDK 9 no later than January 2019 when the development for the next release freezes. Other distributions have similar constraints. It is not feasible to support more than one JDK because we want to ensure that all software can be built from source. It's also quite problematic security wise because a release is supported for five years and for instance OpenJDK 6 has reached EOL status in April 2017 and is no longer supported in any of Debian's distributions. But that's just FYI.

    Thank you for looking into this issue.

     
  • Emmanuel Bourg

    Emmanuel Bourg - 2018-03-12

    This compilation error can be fixed with this modification to FileContentManager.java:

    --- a/src/com/eteks/sweethome3d/swing/FileContentManager.java
    +++ b/src/com/eteks/sweethome3d/swing/FileContentManager.java
    @@ -1219,7 +1219,7 @@
    
           public int updateChildren(File [] childDirectories) {
             if (this.children == null) {
    
    -          this.children = new Vector<File>(childDirectories.length);
    +          this.children = new Vector(childDirectories.length);
             }
             synchronized (this.children) {
               removeAllChildren();
    
     

    Last edit: Emmanuel Bourg 2018-03-12

Log in to post a comment.

MongoDB Logo MongoDB