0

I was getting this error after clicking the test connection button for a MongoDB connection in the IntelliJ IDEA Database tab:

enter image description here

Driver class 'com.dbschema.MongoJdbcDriver' is incompatible with current JRE.

It took me over an hour to fix this because there were literally no results when I googled for the exact search term.

There are multiple ways to fix this error, which I'll post below.

asked Dec 11, 2025 at 0:48

1 Answer 1

0

For some reason, my IntelliJ IDEA (the IDE itself, not my code) was bootstrapped from JDK 17. Using a newer version fixed the error. Here's how I did that:

  1. Go to Help -> Find Action

  2. Type "Choose Boot Java Runtime for the IDE"

  3. Select a newer Java version. I chose Java 21:

    enter image description here

  4. IntelliJ will ask you to restart. Click Okay.

  5. The Driver class 'com.dbschema.MongoJdbcDriver' is incompatible with current JRE error went away and I was able to successfully connect.

Obviously that warning in step 3 is pretty suspicious. It doesn't bother me because I'm just trying to get past this, and I'll be setting up a new computer in a few days.

Alternatively, you could use a different MongoDB driver than the one that comes with IntelliJ IDEA, but I tried and ran into different connection problems with that.

I could have tried using an older version of the IntelliJ IDEA MongoDB driver until it was compatible with the IntelliJ IDEA runtime, but I didn't go down that route myself. I can't guarantee it'll solve the problem.

answered Dec 11, 2025 at 0:48
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.