Before running the TOS Java SDK, you must first install the SDK. This article outlines the operating environment requirements and provides multiple installation methods for the SDK.
Environmental Preparation
- The SDK requires JDK version 1.8 or above to run on.
- All example code presented in this article can be executed successfully on IntelliJ IDEA and utilizes Maven version 3.6.3 as the package management tool.
The Java SDK depends on OkHttp. It is recommended to use version 4.x of the OkHttp library. The minimum required version of OkHttp is 3.9.1; using a lower version may result in the SDK failing to compile properly.
Download Link
Installation Method
Currently, the TOS Java SDK supports three installation methods: installation via Maven, installation via Gradle, and direct installation using a Jar package. Using SDK version 2.8.8 as an example, the configuration is as follows.
tip
It is recommended that you use the latest version of the SDK; the latest version is determined by the updates on Git.
Installation via Maven
Configure as follows in the pom.xml file.
Installation via Gradle
Configure the build.gradle file as follows, and add dependencies in the dependencies section.
Integration via JAR package
tip
Before introducing via the JAR package, please download the latest JAR package file. Import the ve-tos-java-sdk JAR package into the IntelliJ IDEA project.
- Copy the downloaded ve-tos-java-sdk-2.8.8.jar file into your project.
- In IntelliJ IDEA, select your project, right-click, and choose File > Project Structure > Modules > Dependencies > + > JARs or directories.
- Select the ve-tos-java-sdk-2.8.8.jar file and import it into External Libraries.
Import the ve-tos-java-sdk JAR package into the Eclipse project.
- Copy the downloaded ve-tos-java-sdk-2.8.8.jar file into your project.
- In Eclipse, select your project and right-click to choose Properties >. Java Build Path > Add JARs.
- Select the ve-tos-java-sdk-2.8.8.jar file and import it into Libraries.