Impact Acquire SDK Java
Building And Running Applications Using Impact Acquire
Note
Most of the native source code that later is compiled into the mvIMPACT_Acquire.java-lib is generated using SWIG. To build and test the Java API we are currently using JDK 8.231.0! If you encounter issues with this or other versions of Java you are working with please get in touch!

The complete Java part of the interface is provided as a *.jar-archive (mvIMPACT_Acquire.jar) accompanied by a JNI shared library (mvIMPACT_Acquire.java.dll/.so). For details on supported platforms and releases also see here: Device And Operating System Support Across Released Versions

Running Example Applications

Running example applications which are shipped as part of the Impact Acquire driver package installation should be straightforward if you are familiar with Java make sure that:

  • the mvIMPACT_Acquire.jar is part of the class path when you invoke the Java compiler(javac executable) or the Java runtime(Java executable)
  • you compile ALL the required Java source code needed for running the individual example applications (some my require multiple source files like an additional capture thread class)
  • the native user mode libraries as well as the Java native interface(JNI) based Impact Acquire runtime can be found in the operating systems library search path

Windows®

For the ContinuousCapture example the necessary invocations may look like this

set JAVA_BIN=<path to your Java binary folder>
set JAR_ARCHIVES=%MVIMPACT_ACQUIRE_DIR%/bin/x64/mvIMPACT_Acquire.jar
cd %MVIMPACT_ACQUIRE_DIR%/apps/Java/ContinuousCapture
%JAVA_BIN%\javac -cp %JAR_ARCHIVES% ContinuousCapture.java CaptureThread.java
%JAVA_BIN%\java  -cp .;%JAR_ARCHIVES% ContinuousCapture

Linux

For the ContinuousCapture example the necessary invocations may look like this

JAVA_BIN=<path to your Java binary folder>
JAR_ARCHIVES=$MVIMPACT_ACQUIRE_DIR/lib/x86_64/mvIMPACT_Acquire.jar
cd $MVIMPACT_ACQUIRE_DIR/apps/Java/ContinuousCapture
$JAVA_BIN\javac -cp $JAR_ARCHIVES ContinuousCapture.java CaptureThread.java
$JAVA_BIN\java  -cp .:$JAR_ARCHIVES ContinuousCapture

Troubleshooting

  • If either java or javac is reported missing / misspelled you didn't define the JAVA_BIN variable correctly
  • If some error is reported that suggests that mvIMPACT_Acquire.jar cannot be found either the JAR_ARCHIVES path from the examples above is incorrect OR the Impact Acquire JNI library (on Windows mvIMPACT_Acquire.java.dll, on Linux libmvIMPACT_Acquire.java.so) cannot be found in the systems search path
  • If something like 'java.lang.UnsatisfiedLinkError: <SomePath>/mvIMPACT_Acquire.java.dll: Can't find dependent libraries' then the Impact Acquire JNI library (on Windows mvIMPACT_Acquire.java.dll, on Linux libmvIMPACT_Acquire.java.so) has been found, but one or more of the underlying Impact Acquire libraries (e.g. the mvDeviceManager-lib) is missing in the systems search path