Menu

#188 Support Java 11

v6.1
closed
None
5
2019-07-08
2018-08-09
No

Java 11 introduces far-reaching changes in the bytecode specifications:
JEP 181: Nest-Based Access Control
JEP 309: Dynamic Class-File Constants

Discussion

  • Jason S

    Jason S - 2018-09-27

    Ok, sounds challenging? do you think you'll be able to turn this around quickly? When do you think you'll have this released.

    Java 11 was out this week, I tried compiling my project with it (upgrading from Java 10) and I think proguard is the only thing not working.

    i think this product is great by the way.

     
  • Ben Tatham

    Ben Tatham - 2018-10-04
    +1
    
     
  • Hendrik Schreiber

    +1

     
  • Mark Baird

    Mark Baird - 2018-11-15

    +1 for Java 11 support. I'm also a big fan of ProGuard so keen to have it working for Java 11. Any feeling for when it will be ready?

     

    Last edit: Mark Baird 2018-11-15
  • Joy dev

    Joy dev - 2018-11-28

    Hi, Is there an update on Java 11 support?

     
  • Michael L.

    Michael L. - 2018-12-17

    +1, is there any schedule for this milestone

     
  • Tim Friedrich

    Tim Friedrich - 2018-12-20

    +1, is there any status update?

     
  • Emin Kokalari

    Emin Kokalari - 2018-12-26

    +1, for status update

     
  • Eric Lafortune

    Eric Lafortune - 2019-01-09

    ProGuard 6.1.0 beta2 (available now) supports Java 10, 11 and 12.

     
  • Boris Petrov

    Boris Petrov - 2019-01-10

    Thanks, Eric, you're the best!

     
  • Michael L.

    Michael L. - 2019-01-11

    Perfect, runs smoothly. Thanks, Eric.

     
  • Hendrik Schreiber

    Awesome, Eric. Looking forward to trying it out!

     
  • Nick Talbot

    Nick Talbot - 2019-04-24

    Just tried updating from 6.0.3 to 6.1.0beta2 ready for Java 11 but am hitting the following issue with both Java 10 and 11 (Java 10 was running fine with 6.0.3):

    2019-04-24 14:23:57 INFO  [proguard] Initializing...
    2019-04-24 14:24:00 INFO  [proguard] Ignoring unused library classes...
    2019-04-24 14:24:00 INFO  [proguard]   Original number of library classes: 53156
    2019-04-24 14:24:00 INFO  [proguard]   Final number of library classes:    3532
    2019-04-24 14:24:04 INFO  [proguard] Printing kept classes, fields, and methods...
    2019-04-24 14:24:04 INFO  [proguard] Inlining subroutines...
    2019-04-24 14:24:04 INFO  [proguard] Obfuscating...
    2019-04-24 14:24:08 INFO  [proguard] Printing mapping to [/path/to/proguard.map]...
    2019-04-24 14:24:15 INFO  [proguard] Preverifying...
    2019-04-24 14:24:29 INFO  [proguard] java.lang.IllegalArgumentException: Comparison method violates its general contract!
    2019-04-24 14:24:29 INFO  [proguard]    at java.base/java.util.ComparableTimSort.mergeLo(ComparableTimSort.java:748)
    2019-04-24 14:24:29 INFO  [proguard]    at java.base/java.util.ComparableTimSort.mergeAt(ComparableTimSort.java:485)
    2019-04-24 14:24:29 INFO  [proguard]    at java.base/java.util.ComparableTimSort.mergeCollapse(ComparableTimSort.java:413)
    2019-04-24 14:24:29 INFO  [proguard]    at java.base/java.util.ComparableTimSort.sort(ComparableTimSort.java:213)
    2019-04-24 14:24:29 INFO  [proguard]    at java.base/java.util.Arrays.sort(Arrays.java:1315)
    2019-04-24 14:24:29 INFO  [proguard]    at proguard.classfile.editor.ConstantPoolSorter.visitProgramClass(ConstantPoolSorter.java:75)
    2019-04-24 14:24:29 INFO  [proguard]    at proguard.classfile.ProgramClass.accept(ProgramClass.java:430)
    2019-04-24 14:24:29 INFO  [proguard]    at proguard.classfile.editor.ClassElementSorter.visitProgramClass(ClassElementSorter.java:47)
    2019-04-24 14:24:29 INFO  [proguard]    at proguard.classfile.ProgramClass.accept(ProgramClass.java:430)
    2019-04-24 14:24:29 INFO  [proguard]    at proguard.classfile.ClassPool.classesAccept(ClassPool.java:125)
    2019-04-24 14:24:29 INFO  [proguard]    at proguard.ProGuard.sortClassElements(ProGuard.java:514)
    2019-04-24 14:24:29 INFO  [proguard]    at proguard.ProGuard.execute(ProGuard.java:216)
    2019-04-24 14:24:29 INFO  [proguard]    at proguard.ProGuard.main(ProGuard.java:586)
    
     
    • Eric Lafortune

      Eric Lafortune - 2019-04-24

      Thanks for your report. This seems to be the same problem as the recently reported bug #745. Do you also have a statically initialized array of floats or doubles, where one of the elements is an unusual value like NaN, +Inf, or -Inf? Otherwise, can you share a small sample that reproduces the problem?

       
  • Nick Talbot

    Nick Talbot - 2019-04-25

    Thanks Eric. I only found one instance of this (using NaN) in the main code (loads in unit tests which should be excluded anyway). The codebase is nearly 1 million lines so will struggle to pin down the exact issue. As the bug looks like a compara[tor|ble] regression I was hoping it would be easy for you to find... :-)

    I will wait to test the next build after #745 is resolved as there's a good chance it's the same issue.

    Cheers

     
  • Peter Burka

    Peter Burka - 2019-04-26

    Hi Eric. Do you have an approximate timeline for 6.1beta3 and 6.1 GA?

    Thanks!

     
  • Nick Talbot

    Nick Talbot - 2019-05-16

    I've just tried 6.1.0 on our project. It no longer crashes on Java 10 and also runs fine when we build with OpenJDK 11.0.3

    Thanks!

     
  • Eric Lafortune

    Eric Lafortune - 2019-05-16
    • Status: accepted --> closed
     
  • FiReTiTi

    FiReTiTi - 2019-06-27

    I've tried to run it with Java 11, and it does not work. I get the following error:

    ProGuard, version 6.1.1
    Reading program jar [/Users/firetiti/NetBeans/FiReTiTiLiB/dist/FiReTiTiLiB.jar]
    Reading program jar [/Users/firetiti/NetBeans/FiReTiTiLiB/dist/lib/FiReTiTiCoreJava.jar]
    Reading library jar [/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home/lib/rt.jar]
    Error: Can't read [/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home/lib/rt.jar] (No such file or directory: /Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home/lib/rt.jar)

    Any idea how to fix it?

     
    • Hendrik Schreiber

      What's your config? You know that JDK 11 does not have a /Contents/Home/lib/rt.jar, right?

       
      • FiReTiTi

        FiReTiTi - 2019-06-27

        Indeed, this file does not exist anymore on Java 11. It seems that it was removed on Java 9.
        I work on a macos with Java 11.
        As the file does not exists anymore, why is proguard looking for it?

         

        Last edit: FiReTiTi 2019-06-27
        • Hendrik Schreiber

          I don't think you've discovered a bug.

          What's your config?

          I.e., how are you calling ProGuard?

           
          • FiReTiTi

            FiReTiTi - 2019-06-28

            I use ProGuard 6.1.1 on Java 11.0.2 on macosX 10.13.6
            I call this command: java -jar ./lib/proguard.jar @MyApp.pro
            It seems that the call to rt.jar comes from my config file that comes from a old proguard version, so I commented the line.
            Thanks.

             
          • FiReTiTi

            FiReTiTi - 2019-07-08

            I still have too many warnings for basic libraries, so I opened a post on StackOverflow: https://stackoverflow.com/questions/56920082/proguard-does-not-find-basic-packages-and-super-class

             

Log in to post a comment.