Help Center/ MapReduce Service/ Developer Guide (LTS)/ Kafka Development Guide (Normal Mode)/ Application Commissioning/ Commissioning an Application in Linux
Updated on 2022-11-18 GMT+08:00
Commissioning an Application in Linux
Scenario
Run a sample program in Linux after code development is complete.
Procedure
- In IntelliJ IDEA, configure the Artifacts information of the project before generating the JAR package.
- Enter IntelliJ IDEA and choose File > Project Structure.
- On the Project Structure page, select Artifacts, click the plus sign (+), and choose JAR > Empty. Figure 1 Add Artifacts
- Set the name, type, and output path of the JAR package based on the site requirements.
- Choose 'kafka-examples' compile output, right-click Put into Output Root, and click Apply. Figure 3 Put into Output Root
- Click OK to complete the configuration.
- Generate the JAR package.
- Enter IntelliJ IDEA and choose Build > Build Artifacts. Figure 4 Build Artifacts
- In the displayed interface, choose kafka-example:jar > Build to generate the JAR package. Figure 5 Build
- If log similar to the following is displayed in event logs, the JAR package is successfully generated. Obtain the JAR package from the Output directory configured shown in Figure 2
14:37 Compilation completed successfully in 25 s 991 ms
- Enter IntelliJ IDEA and choose Build > Build Artifacts.
- Copy the generated jar package to /opt/client/lib. Figure 6 File Location
- Copy all files in the src/main/resources directory of the IntelliJ IDEA project to the src/main/resources directory at the same level as the lib folder, that is, /opt/client/src/main/resources.
- Ensure that the current user has read permission of all the files in the src/main/resources and lib folders in /opt/client, jdk has been installed,and java environment variables are set. Then, run the command, for example, java -cp /opt/client/lib/*:/opt/client/src/main/resources com.huawei.bigdata.kafka.example.Producer to run the example project.
Parent topic: Application Commissioning
What is your overall rating for this page?
0
1
2
3
4
5
6
7
8
9
10
Very dissatisfiedVery satisfied
Thank you very much for your feedback. We will continue working to improve the documentation.
The system is busy. Please try again later.
