Migrate to Java 11 with gradle; UnsupportedOperationException

ASM v7 has been released.

Gradle issue has been closed and fix is available at Gradle 5.0 RC1 or later.

Binaries should be soon available for download.


Java 11 added nest based access, so any byte code writing APIs like ASM had to be updated to support the class-file changes.

Looking at the source code for that method in the 6.2.1 version of ASM (which is the one that gradle seems to be using):

  @Deprecated
  public void visitNestMemberExperimental(final String nestMember) {
    if (api < Opcodes.ASM7_EXPERIMENTAL) {
      throw new UnsupportedOperationException();
    }
    if (cv != null) {
      cv.visitNestMemberExperimental(nestMember);
    }
  }

The API level required is 7 which is currently in beta. I guess they are waiting for a release version of ASM 7 before updating the dependency.