Artur
Artur

Reputation: 791

java.lang.NoClassDefFoundError at Class.java:-2

Having following code: https://github.com/arturmkr/myReportProblem

Using Java 11.

When I try to execute it I am having issue:

./gradlew clean ui:test 

> Task :ui:test FAILED

com.db.demo.ui.DummyCheck > initializationError FAILED
    java.lang.NoClassDefFoundError at Class.java:-2
        Caused by: java.lang.ClassNotFoundException at BuiltinClassLoader.java:581

1 test completed, 1 failed

Who could help?

Upvotes: 2

Views: 7036

Answers (2)

Dmitry Kaltovich
Dmitry Kaltovich

Reputation: 2270

I just removed from build.gradle.kts:

jar { enabled = false }

And it helped

Upvotes: 0

Onur Baştürk
Onur Baştürk

Reputation: 735

Ok now it works (but your tests fail):

  1. Add to your non-Spring boot project's build.gradle (I mean your repository project's build.gradle)

    bootJar 
    {
        enabled = false
    }

    jar 
    {
        enabled = true
    }
  1. ./gradlew clean build

Upvotes: 1

Related Questions