Compiling and Running an Application When a Client Is Installed
Scenario
HBase applications can run in a Linux environment where an HBase client is installed. After application code development is complete, you can upload a JAR file to the Linux environment to run applications.
Prerequisites
- You have installed an HBase client.
- You have installed a JDK in the Linux environment. The version of the JDK must be consistent with that of the JDK used by Eclipse to export the JAR file.
Procedure
- Export a JAR file.
- Right-click the sample project and choose Export from the shortcut menu.
Figure 1 Exporting a JAR file
- Select JAR file and click Next.
Figure 2 Selecting JAR file
- Select the src and conf directories, and export the JAR file to the specified location. Click Next twice.
Figure 3 Selecting a path for exporting the JAR file
- Click Finish. Exporting the JAR file is complete.
- Right-click the sample project and choose Export from the shortcut menu.
- Run the JAR file.
- Before running the JAR file on the Linux client, copy the JAR file generated in the application development environment to the lib directory in the client installation directory, and ensure that the permission of the JAR file is the same as that of other files.
- Switch to the bin directory in the client directory as the installation user, and then run the following command to Run the JAR file:
[Ruby@cloudtable-08261700-hmaster-1-1 bin]# ./hbase com.huawei.cloudtable.hbase.examples.TestMain
com.huawei.cloudtable.hbase.examples.TestMain is used as an example. Use the actual code instead.
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.
For any further questions, feel free to contact us through the chatbot.
Chatbot