Help Center/
MapReduce Service/
Developer Guide (LTS)/
Spark2x Development Guide (Common Mode)/
FAQs About Spark Application Development/
How to Add a User-Defined Library
Updated on 2024-08-10 GMT+08:00
How to Add a User-Defined Library
Question
In the development of the Spark application, users may add a user-defined dependent library which is different from the sample project. This section describes how to add a dependent library with user-defined codes into the project.
Answer
- On the main page of the IDEA, choose Project Structure page. to access the
- Select the Libraries tab, click + on the following page, and add the local dependent library.
Figure 1 Add the Dependent Library
- Click Apply to load the dependent library and click OK to complete the configuration.
- 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.
- On the Project Structure page, select the Artifacts tab.
- Click + and select Library Files in the right window to add the dependent library.
Figure 2 Add Library Files
- Choose the dependent library to be added and click OK.
Figure 3 Choose Libraries
- Click Apply to load the dependent library and click OK to complete the configuration.
Parent topic: FAQs About Spark Application Development
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot