Complete build guide for compiling the native C++ Win32 SendInput and DirectX capture engine and packaging the Java JAR.
- Windows 10 or 11 (64-bit)
- JDK 17+ (Eclipse Adoptium or Oracle JDK)
- Visual Studio 2022 or 2026 (Community, Professional, or Enterprise) with "Desktop development with C++" workload
- Windows 10/11 SDK (installed with Visual Studio)
- Maven 3.9+
FastRobot includes an automated compilation script with Visual Studio and JDK discovery:
# In the FastRobot repository root:
compile.batWhat compile.bat does automatically:
- Detects Visual Studio 2026 / 2022 Community via
vswhere.exe. - Initializes the 64-bit developer environment (
vcvars64.bat). - Compiles
native/fastrobot.cppandnative/DXGICapture.cppwith/O2and links Win32 user/GDI and DirectX libraries. - Deploys
fastrobot.dlldirectly to:build/fastrobot.dllsrc/main/resources/native/fastrobot.dll%USERPROFILE%\.fastcore\native\fastrobot\fastrobot.dll
mvn clean install -DskipTestsTo build and execute the official JMH benchmark suite:
run-benchmark.bat| Command | Purpose |
|---|---|
compile.bat |
Build native DLL (requires Visual Studio) |
mvn clean compile |
Compile Java only |
mvn clean package |
Build JAR with DLL |
mvn clean package -DskipTests |
Fast build |
All examples are in examples/00-basic-usage/:
cd examples/00-basic-usage
mvn compile exec:javanative/
├── fastrobot.cpp # Main JNI implementation
├── fastrobot.h # JNI header
├── DXGICapture.cpp # DirectX capture
└── DXGICapture.h # DirectX header
"Cannot find cl.exe" — Run in "Developer Command Prompt for VS 2019/2022"
"UnsatisfiedLinkError: no fastrobot in java.library.path" — Run compile.bat first
"DXGI_ERROR_NOT_FOUND" — Ensure Windows 10/11 with DirectX 11+ GPU