Hello, Helen!
You can use the following method to add it.
1. On the main page of the IDEA, choose File > Project Structures... to access the Project Structure page.
2. Select the Libraries tab, click the icon "+" on the following page, and add the local dependent library.
Figure 1 Add the Dependent Library

3. Click Apply to load the dependent library and click OK to complete the configuration.
4. Add the dependent library when building Artifacts. This is because the user-defined dependent library does not exist in the operating environment. By adding the library, the created jar contains the user-defined dependent library, which ensures that the Spark application runs properly.
a. On the Project Structure page, select the Artifacts tab.
b. Click the icon "+" and select Library Files in the right window to add the dependent library.
Figure 2 Add Library Files

c. Choose the dependent library to be added and click OK.
Figure 3 Choose Libraries

d. Click Apply to load the dependent library and click OK to complete the configuration.
Hope this helps!