Skip to the content.
English 한국어 日本語 Tiếng Việt

Java Example

https://github.com/bobhyun/TS-ANPR/tree/main/examples/Java/anpr

1. Copying the Engine Files

[Note] In this example, the engine file is extracted to the examples/bin/ directory to share it with other examples. However, for actual deployment, the engine file is typically copied to the directory where the application’s executable file is located.

2. How to Build

  1. Native(JNI) Module

    • Windows 64bit (MSVC, x64 Native Tools Command Prompt)

      mkdir build\windows-x86_64
      cd build\windows-x86_64
      
      cmake ..\.. -A x64
      
      cmake --build . --config Debug   # Debug build
      cmake --build . --config Release # Release build
      
    • Windows 32bit (MSVC, x86 Native Tools Command Prompt)

      mkdir build\windows-x86
      cd build\windows-x86
      
      cmake ..\.. -A Win32
      
      cmake --build . --config Debug   # Debug build
      cmake --build . --config Release # Release build
      
    • Linux x86_64

      mkdir -p build/linux-x86_64
      cd build/linux-x86_64
      
      # Debug build
      cmake ../.. -DCMAKE_BUILD_TYPE=Debug
      make
      
      # Release build
      cmake ../.. -DCMAKE_BUILD_TYPE=Release
      make
      
    • Linux aarch64 (ARM64)

      • Build directly on the aarch64 machine

        mkdir -p build/linux-aarch64
        cd build/linux-aarch64
        
        # Debug build
        cmake ../.. -DCMAKE_BUILD_TYPE=Debug
        make
        
        # Release build
        cmake ../.. -DCMAKE_BUILD_TYPE=Release
        make
        
      • Cross-compile on x86_64

        mkdir build/linux-aarch64
        cd build/linux-aarch64
        
        # Debug build
        cmake ../.. -DCMAKE_TOOLCHAIN_FILE=../../toolchain-aarch64.cmake -DCMAKE_BUILD_TYPE=Debug
        make
        
        # Release build
        cmake ../.. -DCMAKE_TOOLCHAIN_FILE=../../toolchain-aarch64.cmake -DCMAKE_BUILD_TYPE=Release
        make
        
  2. Java Module

    mvn clean package
    

3. How to Run

# Run this if non-ASCII characters appear garbled on Windows.
chcp 65001

mvn exec:java -Dexec.mainClass=com.example.anpr.Main