Version: 1.3
语言 : 中文
Getting started with OpenHarmony
OpenHarmony Player settings

OpenHarmony environment settings

To create a Tuanjie application for OpenHarmony, you first need to set up your Tuanjie project to support OpenHarmony. To support OpenHarmony, a Tuanjie project requires the following dependencies:

  • The OpenHarmony Build Support module.
  • The OpenHarmony Software Development Kit (SDK).
  • A Java Development Kit. By default, Tuanjie uses OpenJDK.

Before you get started, check Tuanjie’s Requirements and compatibility documentation for OpenHarmony to make sure you’re aware of any limitations for developing a Tuanjie application for OpenHarmony.

Installing dependencies

Tuanjie distributes dependencies as modules which means you use the Tuanjie Hub to install them. You can install them either when you install a new Tuanjie Editor version, or add them to an existing Tuanjie Editor install. To install modules:

  • At install time, you can check the OpenHarmony module while downloading the editor though Tuanjie Hub.
  • To an existing install, you can add module for your existing install. Preferences window showing installs for OpenHarmony

The four modules to install are:

  • OpenHarmony Build Support
  • OpenHarmony SDK
  • Node.js SDK Tools
  • OpenJDK

Tuanjie installs OpenHarmony SDK & Node.js SDK and OpenJDK respectively in the SDK, nodejs, and OpenJDK folders under /Tuanjie/Hub/Editor/[EditorVersion]/Editor/Data/PlaybackEngines/OpenHarmonyPlayer/.

Customizing dependencies

You should use the Tuanjie Hub to install OpenHarmony SDK & Node.js tools and OpenJDK to ensure that you receive the correct versions and configurations. However, there are situations where it’s useful to change the SDK, Node.js, or JDK that Tuanjie uses to build applications for OpenHarmony. For example, if you have multiple versions of Tuanjie with the same dependencies and you don’t want to duplicate the installation of the SDK, Node.js, and JDK, you can specify a shared location.

To make Tuanjie use a custom version of a dependency:

  1. Download the custom version of the dependency. Warning: Tuanjie only officially supports versions of the OpenJDK, SDK, or Node.js that it supplies through the Hub.
  2. In Tuanjie, select Edit > Preferences (macOS: Tuanjie > Preferences).
  3. In the left navigation column, select External Tools. The OpenHarmony section of the External Tools panel contains entries for SDK, Node.js, and JDK. Each entry contains:
    • A checkbox that indicates whether to use the version that Tuanjie provides or a custom version.
    • The path to the dependency’s installation folder.
      Preferences window showing external tools settings for OpenHarmony
  4. To customize the installation for any of these dependencies, disable the dependency’s respective …installed with Tuanjie (recommended) checkbox then click Browse and select the installation folder for the custom dependency.
Getting started with OpenHarmony
OpenHarmony Player settings