- JDK 17+ — Download
- Maven 3.9+ — Download
- Visual Studio 2022 — Community/Professional/Enterprise/BuildTools
# 1. Build native DLL first (Windows)
compile.bat
# 2. Build JAR
mvn clean package -DskipTests| Command | Purpose |
|---|---|
compile.bat |
Build native DLL (Windows) |
mvn clean compile |
Compile Java only |
mvn clean package |
Build FatJAR with DLL embedded |
mvn test |
Run unit tests |
The compile.bat script:
- Auto-detects Visual Studio 2019/2022
- Auto-detects JAVA_HOME
- Uses
native\fastaudioprocess.deffor JNI exports - Outputs to
build\fastaudioprocess.dll
The Maven pom.xml will automatically pick up build\fastaudioprocess.dll and bundle it inside the JAR.
When using JNI, you MUST export your native functions in the native\fastaudioprocess.def file:
LIBRARY fastaudioprocess
EXPORTS
Java_fastaudioprocess_FastAudioProcess_doSomethingNative
Important: Function names must match Java's expected format:
- Pattern:
Java_packagename_Classname_methodname
Without the .def file, JNI methods won't be exported and you'll get UnsatisfiedLinkError.