Skip to content

JDK>17: unit test fail to compile: Task :compileTestGroovy FAILED #1038

@jpstotz

Description

@jpstotz

When using a JDK newer than Java 17 the gradle task compileTestGroovy will fail:

* What went wrong:
Execution failed for task ':compileTestGroovy'.
> BUG! exception in phase 'semantic analysis' in source unit 'sshj\src\test\groovy\com\hierynomus\sshj\common\KeyTypeSpec.groovy' Unsupported class file major version 65

As workaround you can change the java entry in build.gradle to use a JDK 17 toolchain:

java {
  toolchain {
    languageVersion = JavaLanguageVersion.of(17) 
  }
  withJavadocJar()
  withSourcesJar()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions