Menu

Java 11 Support?

jtsf11
2018-08-09
2019-04-02
  • jtsf11

    jtsf11 - 2018-08-09

    We updated ProGuard 6.0.3 to support the Java 11 major number. ProGuard compiles and works correctly without reporting an unsupported compilation. However, when we compile our code with Java 11 (openjdk) we get thousands of can't find referenced [field|method] errors. When we compille with OpenJDK Java 10, running our new version of ProGuard, we have no errors. I suspect this is due to the class file change that was introduced in Java 11 (https://bugs.openjdk.java.net/browse/JDK-8010319).

    A workaround is to compile using the Java 11 compiler and use the --release 10 flag when compiling which will output Java 10 compatible classes. ProGuard is then able to shrink/optimize/obfuscate without errors using the Java 11 jmods and our Java 10 classes.

    Are there any plans and a timeframe for fully supporting Java 11 in ProGuard?

     
    • Paul Russell

      Paul Russell - 2018-08-09

      Yeah - I'd love to see this too.

      On Thu, 9 Aug 2018 at 14:53, J Theisen jtsf11@users.sourceforge.net wrote:

      We updated ProGuard 6.0.3 to support the Java 11 major number. ProGuard
      compiles and works correctly without reporting an unsupported compilation.
      However, when we compile our code with Java 11 (openjdk) we get thousands
      of can't find referenced [field|method] errors. When we compille with
      OpenJDK Java 10, running our new version of ProGuard, we have no errors. I
      suspect this is due to the class file change that was introduced in Java 11
      (https://bugs.openjdk.java.net/browse/JDK-8010319).

      A workaround is to compile using the Java 11 compiler and use the --release
      10
      flag when compiling which will output Java 10 compatible classes.
      ProGuard is then able to shrink/optimize/obfuscate without errors using the
      Java 11 jmods and our Java 10 classes.

      Are there any plans and a timeframe for fully supporting Java 11 in
      ProGuard?


      Java 11 Support?
      https://sourceforge.net/p/proguard/discussion/182455/thread/1d8a709f/?limit=25#9b86


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/proguard/discussion/182455/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
  • Eric Lafortune

    Eric Lafortune - 2018-08-09

    Yes, ProGuard will support Java 11. The changes in the bytecode specifications are far-reaching, so it's not just a small fix and it will take time. I'll add a feature request for reference.

     
  • Joy dev

    Joy dev - 2018-11-28

    Hi, Is there an update on Java 11 support?

     
  • Marius Mikučionis

    Hi, I just tried 6.1.0beta2 and it worked for me with JDK11.0.1.

     
  • jtsf11

    jtsf11 - 2019-03-27

    Yup. 6.10beta2 works with java11. I no longer need the --release 10 javac flag. However, I get an error when shrinking:

    ProGuard, version 6.1.0 beta2
    Reading input...
    Reading program jar …
    Reading library directory …
    Reading library directory …
    Initializing...
    Ignoring unused library classes...
    Original number of library classes: 39493
    Final number of library classes: 1516
    Inlining subroutines...
    Shrinking...
    Exception in thread "main" java.lang.NullPointerException
    at proguard.shrink.UsageMarker.isUsed(UsageMarker.java:1198)
    at proguard.shrink.ClassShrinker.shrinkConstantIndexArray(ClassShrinker.java:468)
    at proguard.shrink.ClassShrinker.visitNestMembersAttribute(ClassShrinker.java:215)
    at proguard.classfile.attribute.NestMembersAttribute.accept(NestMembersAttribute.java:64)
    at proguard.classfile.ProgramClass.attributesAccept(ProgramClass.java:619)
    at proguard.shrink.ClassShrinker.visitProgramClass(ClassShrinker.java:113)
    at proguard.classfile.visitor.MultiClassVisitor.visitProgramClass(MultiClassVisitor.java:67)
    at proguard.shrink.UsedClassFilter.visitProgramClass(UsedClassFilter.java:62)
    at proguard.classfile.ProgramClass.accept(ProgramClass.java:430)
    at proguard.classfile.ClassPool.classesAccept(ClassPool.java:125)
    at proguard.shrink.Shrinker.execute(Shrinker.java:158)
    at proguard.ProGuard.shrink(ProGuard.java:392)
    at proguard.ProGuard.execute(ProGuard.java:146)

    Of course, I can get around this error by using the --dontshrink option which only increases my program by about a meg.

     
  • jtsf11

    jtsf11 - 2019-03-28

    Unfortunately, while 6.1.0beta2 obfuscates successfully without shrinking, my program crashes when running on OS X 10.14. If I use the '--release 10' javac flag, then shrinking works, obfuscation works, and my program works. So for now, I guess I will have to stick with that flag during compilation.

     
  • Joy dev

    Joy dev - 2019-04-02

    Is there a timeline when we can expect a deployable production version ?