Help Center> Optical Character Recognition> SDK Reference> SDK Environment Setup> Preparing a Java Development Environment

Preparing a Java Development Environment

Scenario

OCR JAVA SDK supports Windows, Linux, and Mac operating systems. This section uses Windows as an example to describe how to configure the environment. Table 1 describes the required operating environment.

Table 1 Environment preparation

Item

Description

Operating system (OS)

Windows OS. Windows 7 or later is recommended.

Installing JDK

Basic configuration for the development environment. The version must be JDK 8 or later.

Installing and configuring Eclipse

Tool used for developing OCR applications

Procedure

The following describes how to configure the JDK 8 (64-bit) in the Windows 7 environment. If you have downloaded JDK and configured the environment, skip steps 1 to 4. The following uses Eclipse as an example to describe how to import the SDK project. Operations of other IDEs are similar to those of Eclipse.

  1. Download the JDK file.
  2. After the JDK file is downloaded, install the JDK as prompted. For example, install the JDK to the C:\Program Files\Java\jdk1.8.0_131 directory on the local PC.
  3. Right-click Computer, choose Properties > Advanced System Settings > Environment Variables, and perform the following operations to configure Java environment variables:
    1. Create system variable JAVA_HOME whose value is the JDK installation path.
    2. Add %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin to Path. Separate multiple values with semicolons (;).
  4. Open the command line interface (CLI) and run java -version. If the information shown in Figure 1 is displayed, the configuration is successful.
    Figure 1 Java version information
  5. Install Eclipse

    Download Eclipse, for example, eclipse-jee-mars-R-win32-x86_64.zip, from https://www.eclipse.org/downloads/packages/. Extract and open Eclipse. Configure the correct JRE path in Window > Preferences > Java > Installed JREs.

  6. Import the Java SDK project.
    1. Right-click on the Package Explorer page on the left and choose Import from the shortcut menu.
    2. Choose General > Existing Projects into Workspace.
    3. Click Next, select the Maven dependency mode, and select the path where the OCR SDK demo package is stored.
    4. Click Finish to import the demo project. After the demo project is imported, open it. The project directory is as follows:
      Figure 2 Project directory