Support JDK9
Java class file shrinker, optimizer, obfuscator, and preverifier
Brought to you by:
guardsquare
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...
Thanks for the heads-up. I'm aware of the upcoming changes. I haven't decided how to solve the issue yet.
Can we raise the priority of this ?
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
jmod files are zip archives, can't you just use the Zip API?
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).
When can we expect ProGuard 6.0 to be released?
Is there an ETA for Proguard 6.0?
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.
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:
I get:
Tried this, still the same error (can't find superclass or interface java.lang.Object):
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.
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...
According to:
We need to wait 6.0 beta 2 to test Java 9 support.