NoClassDefFoundError : com.couchbase.lite.ConnectionStatus

This is a naive question. I have a simple gradle project (in IntelliJ) on Ubuntu with the dependencies specified as below:

dependencies {
testImplementation ‘org.junit.jupiter:junit-jupiter-api:5.6.0’
testRuntimeOnly ‘org.junit.jupiter:junit-jupiter-engine’
implementation “com.couchbase.lite:couchbase-lite-java-ee:2.8.1”
implementation “com.couchbase.client:java-client:3.1.0”

My code compiles fine. However during runtime, at this line:


I am getting the error:

Exception in thread “main” java.lang.NoClassDefFoundError: com.couchbase.lite.ConnectionStatus
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(
at java.base/java.lang.ClassLoader.loadLibrary(
at java.base/java.lang.System.load(
at com.couchbase.lite.internal.NativeLibrary.load(
at com.couchbase.lite.internal.CouchbaseLiteInternal.init(
at com.couchbase.lite.CouchbaseLite.init(
at com.couchbase.lite.CouchbaseLite.init(
at GettingStarted.main(

To me it seems like couchbaselite library is not getting picked up at runtime. Any help will be greatly appreciated.

Did you follow the instructions in the documentation regarding Linux setups?

1 Like

We can do better with the error message.

If you still get this message after following the setup instructions, you might verify that the directory associated with the java property ‘’ is writeable. If it is null (or empty) the code will use the process current directory.

Yes I have followed the instructions mentioned in the page. If I run the application outside the IntelliJ IDE via commandline, I am now able to get it to work. So I assume some configuration with IntelliJ IDE is wrong which is causing the issue.