Updated on 2024-04-29 GMT+08:00

Configuring and Importing a Project

Background Information

After importing the CloudTable sample code project to Eclipse, you can start learning CloudTable application development samples.

Prerequisites

You have correctly configured the running environment. For details about how to configure the running environment, see Preparing a Windows Running Environment.

Procedure

  1. Import the sample project to the Windows development environment. For details about how to obtain the sample project, see Downloading a Sample Project.
  2. In the application development environment, import the sample project to the Eclipse development environment.

    1. Choose File > Import > General > Existing Projects into Workspace > Next > Browse.

      The Browse Folder dialog box is displayed, as shown in Figure 1.

    2. Select the sample project folder, and click Finish.
      Figure 1 Importing a sample project

  3. Right-click the cloudtable-example project, and choose Properties from the shortcut menu. The Properties for cloudtable-example window is displayed.

    1. In the navigation tree, select Java Build Path. Click the Libraries tab, select all error JDKs, and click Remove, as shown in Figure 2.
      Figure 2 Delete error JDKs
    2. Click Add Library... shown in Figure 3. Select JRE System Library in the pop-up window.
      Figure 3 Adding libraries
    3. In the Add Library dialog box, select a JDK version from the drop-down list of Alternate JRE or Workspace default JRE. Select Alternate JRE and select the JDK version, as shown in Figure 4.
      Figure 4 Selecting JRE
    4. Click Finish to complete configuration and close the window.

  4. Set the Eclipse text file coding format to prevent garbled characters.

    1. On the Eclipse menu bar, choose Window > Preferences.

      The Preferences window is displayed.

    2. In the navigation tree, choose General > Workspace. In the Text file encoding area, select Other and set the value to UTF-8. Click Apply and then OK. Figure 5 shows the settings.
      Figure 5 Setting the Eclipse encoding format

  5. Open the conf/hbase-site.xml file in the sample project and change the value of hbase.zookeeper.quorum to the correct ZooKeeper address.

    <property>
    <name>hbase.zookeeper.quorum</name>
    <value>xxx-zk1.cloudtable.com,xxx-zk2.cloudtable.com,xxx-zk3.cloudtable.com</value>
    </property>

    value is the domain name of the ZooKeeper cluster. Log in to the CloudTable console and choose Cluster Management. In the cluster list, locate the required cluster and obtain the address in the Access Address (Intranet) column.