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()
}
When using a JDK newer than Java 17 the gradle task
compileTestGroovywill fail:As workaround you can change the
javaentry inbuild.gradleto use a JDK 17 toolchain: