Connecting to my database with java

I tried using compass and it works. I’m using mongodb java driver 3.12.6. My java version is 1.8.0_241.

My IDE (eclipse) wants me to change “MongoClient” in:
MongoClient mongoClient = MongoClients.create(<connection string>);
to “com.mongodb.client.MongoClient”, and if I don’t it displays it as an error. My application doesn’t seem to like me using this method since it outputs this error:
java.lang.NoClassDefFoundError: com/mongodb/client/MongoClients