I also have a lot of problems with IntelliJ and dependencies. I am going to share some of my problem-solving methods:
- Make sure
pom.xml has dependencies in it.
This is the first thing to do, and I assume that you have already done it.
For the next step, you can either use the maven tab on the right:

which looks like this when you click it:

or right-click on pom.xml and select Maven like this:

- Reimport
It is quick and easy, and sometimes what is needed.

- Creating sources and updating folders
Sometimes the sources were not correctly generated, then this is the key.

- Download Source
Sometimes IntelliJ does not do this automatically, something that you can change in Settings > Build, Execution, Deployment > Build tools > Maven > Importing and enable Import Maven projects automativally .
Download sources are as follows:

The settings button is the farthest to the right of my Maven tab image examples.
And last but not least:
Place the cursor on the red part of the import (part of import org. json .simple.JSONObject; ) until the red light appears, and select "add to class path".
When everything else is as it should, the class path should be updated with your import. IntelliJ does not always do this automatically.
Gemtastic
source share