jeudi 25 octobre 2018

Cant build a jar with gradle and jdk 11

When I try to create a jar build using gradle and jdk 11, the following error always occurs:

10:53:41: Executing task 'build'...

> Task :compileJava
> Task :compileJava UP-TO-DATE
> Task :processResources UP-TO-DATE
> Task :classes UP-TO-DATE
> Task :bootJar UP-TO-DATE
> Task :jar SKIPPED
> Task :assemble UP-TO-DATE
> Task :compileTestJava UP-TO-DATE
> Task :processTestResources NO-SOURCE
> Task :testClasses UP-TO-DATE
> Task :test FAILED
> Task :jacocoTestReport UP-TO-DATE

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':test'.
> failed to read class file /home/rodrigo/Projetos/Gaia/apipessoas/build/classes/java/test/com/rjdesenvolvimento/apipessoas/ApipessoasApplicationTests.class

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.8.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 1m 9s
6 actionable tasks: 1 executed, 5 up-to-date
Unsupported class file major version 55
10:54:50: Task execution finished 'build'.

I'm lost and need help. I have tried to change the mavencentral () repository to jcenter and without success.

When I use jdk 1.8 the error does not occur, however I need jdk 11, boss orders = (

1 commentaire:

  1. In the file 'gradle-wrapper.properties' update gradle version like so:

    distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip

    RépondreSupprimer