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.
- Copy the 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 example projects 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 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.
Last Article: Preparing for Development and Operating Environment
Next Article: Developing an Application

Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.