Configuring and Importing a Sample Project
- Obtain the sample project folder kafka-examples in the src directory where the sample code is decompressed. For details, see Obtaining Sample Projects from Huawei Mirrors.
- Configure the krb5.conf and user.keytab files.
Copy the krb5.conf and keytab files obtained in Preparing a Developer Account section and all the cluster configuration file obtained in section Preparing an Operating Environment to the kafka-examples\src\main\resources directory of the sample project.
- After installing the IntelliJ IDEA and JDK tools, configure JDK in IntelliJ IDEA.
- Open IntelliJ IDEA and click Configure.
Figure 1 Quick Start
- Choose Project Defaults > Project Structure.
Figure 2 Configure
- In the displayed Project Structure for New Projects interface, click SDKs. Then click the plus sign (+) and choose JDK.
Figure 3 Project Structure for New Projects
- In the displayed Select Home Directory for JDK interface, select the JDK directory, and click OK.
Figure 4 Select Home Directory for JDK
- Click OK.
Figure 5 Completing the JDK configuration
- Open IntelliJ IDEA and click Configure.
- Import the sample project into the IntelliJ IDEA development environment.
- Choose Open.
The dialog box for browsing directories is displayed.
- Select the sample project folder and click OK.
- Choose Open.
- Set the IntelliJ IDEA text file coding format to prevent invalid characters.
- On the IntelliJ IDEA menu bar, choose File > Settings.
The Settings window is displayed.
- Choose Editor > File Encodings in the navigation tree. In the Project Encoding area and Global Encoding area, set the parameter to UTF-8, click Apply, and then click OK, as shown in Figure 6.
- On the IntelliJ IDEA menu bar, choose File > Settings.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.