https://kotlinlang.org logo
#http4k
Title
# http4k
l

Luca Battistelli

12/16/2021, 4:05 PM
Hello everyone, I have created a new project using
http4k generate project -o folder-name -r dD1BQU1BWlFES0FTOEI5Z09FQS1nRDZRU3dCUlEmYz1NYWluJnA9Y29tLmJhdHRpc3RlbGxpLmx1Y2E
but I don't seem to be able to run tests. What am I missing?
Copy code
$ ./gradlew test
Starting a Gradle Daemon, 8 stopped Daemons could not be reused, use --status for details
> Task :test FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':test'.
> There were failing tests. See the report at: file:///Users/lucabattistelli/repos/backend-test-kotlin-2/Main/build/reports/tests/test/index.html

* 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>

BUILD FAILED in 6s
3 actionable tasks: 1 executed, 2 up-to-date
The stack trace is not very helpful
Copy code
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':test'.
...
Caused by: org.gradle.api.GradleException: There were failing tests. See the report at: file:///Users/lucabattistelli/repos/backend-test-kotlin-2/Main/build/reports/tests/test/index.html
s

s4nchez

12/16/2021, 5:00 PM
If you open that index.html file in your browser, what does it tell you?
l

Luca Battistelli

12/16/2021, 5:05 PM
Aha! I had not looked at the stack traces in that page assuming they would be the same
MainClientKt has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
which I guess it means I have to use JDK 1.8?
Setting
Copy code
compileKotlin.kotlinOptions.jvmTarget = "1.8"
compileTestKotlin.kotlinOptions.jvmTarget = "1.8"
in build.gradle did the trick! Maybe
http4k generate project
should be updated? Or there is a way to make it work with JDK 11 (or 17!)
3 Views