Menu

#551 Support JDK9

v5.0
closed-fixed
None
High
2018-08-12
2014-11-24
No

This is much more an RFE than a bug report.

Java 9 will get rid of rt.jar (jigsaw, JEP 220), which IMO will probably lead to some problems when using ProGuard.
More details can be found in this article.

Support for Java9 would be great...

Discussion

  • Eric Lafortune

    Eric Lafortune - 2014-11-25

    Thanks for the heads-up. I'm aware of the upcoming changes. I haven't decided how to solve the issue yet.

     
  • Eric Lafortune

    Eric Lafortune - 2014-11-25
    • status: open --> open-accepted
    • assigned_to: Eric Lafortune
    • Priority: 5 --> 7
     
    • Jason S

      Jason S - 2017-03-01

      Can we raise the priority of this ?

       
      • Eric Lafortune

        Eric Lafortune - 2017-03-05

        I haven't forgotten about it. I'm still hoping for a solution that doesn't require building/running ProGuard with Java 9. As far as I understand, Java 9 provides URLs to read individual class files (good), but no URLs to list all class files in specified Jigsaw modules (inconvenient). It probably requires JDK 9 FileSystem constructs.

        As a solution for the time being, one could create stub jars, similar to rt.jar.

        Eric

         
  • Vincent Privat

    Vincent Privat - 2017-05-27

    jmod files are zip archives, can't you just use the Zip API?

     
    • Eric Lafortune

      Eric Lafortune - 2017-05-29

      The upcoming ProGuard 6.0 supports jmod archives, interpreting them as zip files indeed and reading their special class files and constants. Ironically, the ZipFile API doesn't accept the 4-byte prefix that jmod archives have (as allowed by the zip format).

       
      • Vincent Privat

        Vincent Privat - 2017-08-23

        When can we expect ProGuard 6.0 to be released?

         
  • William

    William - 2017-09-09

    Is there an ETA for Proguard 6.0?

     
  • Sidney Markowitz

    It looks like you might need some support for modular jar files as well as jmod. I'm stuck trying to upgrade an application that is packaged with Install4J to their latest version. It has a jar file that is a modular jar file. The documenation for modular jar format says that it is an ordinary jar with a module-info.class in its root. It can be put in classpath in which case it is used as an ordinary jar and module-info.class is not used. Java 9 can use it as a jmod. The module-info.class in the Install4J i4jruntime.jar file is version 53.0 which causes the current proguard to barf if I try to list it as a library jar.

     
  • Vincent Privat

    Vincent Privat - 2017-11-03

    Thank you for releasing 6.0beta! Is there some documentation for Java 9 support? I don't understand how to make it work with new JDK structure.
    If I use:

            <taskdef resource="proguard/ant/task.properties" classpath="tools/proguard.jar"/>
            <proguard>
            -injars ${dist.jar}
            -outjars ${dist-optimized.jar}
    
            #-libraryjars ${java.home}/lib/rt.jar
            #-libraryjars ${java.home}/lib/jce.jar
            #-libraryjars ${java.home}/lib/ext/jfxrt.jar
    
            -libraryjars ${java.home}/jmods/java.base.jmod
            </proguard>
    

    I get:

     [proguard] Reading library jmod [C:\Program Files\Java\jdk-9.0.1\jmods\java.base.jmod]
     [proguard] Warning: com.drew.imaging.PhotographicConversions: can't find superclass or interface java.lang.Object
    
     
  • Vincent Privat

    Vincent Privat - 2017-11-03

    Tried this, still the same error (can't find superclass or interface java.lang.Object):

            -libraryjars ${java.home}/jmods
            -libraryjars ${java.home}/lib
            -dontwarn com.oracle.jmc.**
    
     
  • Jean-Daniel

    Jean-Daniel - 2017-11-07

    Still broken. To iterate over a jmod, you should use the ZipFile API which was updated to support it. The ZipInputStream API does not works with jmod files.

     
  • brabax

    brabax - 2017-11-28

    With 6.0beta i got "can't find referenced class java.lang.Class" and thousands of other Java references that cannot be found.
    Maybe this helps: https://stackoverflow.com/a/46451977/2951193 ("How to extract the file jre-9/lib/modules?"
    Support for Java9 would be great...

     
  • Eric Lafortune

    Eric Lafortune - 2018-08-12
    • status: open-accepted --> closed-fixed
    • Priority: 7 --> High
     

Log in to post a comment.

MongoDB Logo MongoDB