14

I was trying to use Proguard (6.1.0beta1) but got

(Unsupported version number [55.0] (maximum 54.0, Java 10)))

Are there alternatives to ProGuard which can manage with Java 11?

ZhekaKozlov
  • 36,558
  • 20
  • 126
  • 155
tomasz-mer
  • 3,753
  • 10
  • 50
  • 69

2 Answers2

27

As a follow-up for Karol Dowbecki's answer: ProGuard 6.1.0 beta2 (or newer) supports Java 10, 11 and 12. See #188 Support Java 11


Notice that you'll need to change the libaryjars for Java 9 or newer due to the introduction of the module system. Here's the section of my Gradle Kotlin build script:

if (JavaVersion.current().isJava9Compatible) {
    libraryjars(System.getProperty("java.home") + "/jmods")
} else {
    libraryjars(System.getProperty("java.home") + "/lib/rt.jar")
}
simon04
  • 3,054
  • 29
  • 25
  • I'm facing problems making proguard compatible due to the module system. https://stackoverflow.com/questions/55609008/meta-inf-version-duplicate-error-when-using-proguard. Where exactly do I make the appropriate changes in build.gradle file to account for this and what do I change/add "? – anirudh Apr 10 '19 at 15:00
  • Looks like Java 12 support is still lacking from 6.1.0 beta 2 according to ProGuard issue #190. Linking my comment from it here: https://sourceforge.net/p/proguard/feature-requests/190/?limit=25#81a0. There is no mention of Java 12 in the source code at all. – gonadarian May 08 '19 at 21:33
7

Java 11 have introduced changes to the bytecode and class file format:

Because of above it's unlikely that you will find a working code obfuscator at the moment. Hopefully ProGuard will be updated soon (see #188 Support Java 11 planned for ProGuard 6.1).

Karol Dowbecki
  • 43,645
  • 9
  • 78
  • 111
  • 1
    I would suggest compiling for Java 10. +1 – Peter Lawrey Nov 26 '18 at 10:10
  • it seems I have to do this. – tomasz-mer Nov 26 '18 at 10:15
  • Another thing you could do is take out a support contract - https://www.guardsquare.com/en/support. This will help them find the resources to add new features to your preferred obfuscator ... faster. (Disclaimer: I have no connection or financial stake in GuardSquare or the ProGuard product.) – Stephen C Nov 26 '18 at 11:01