Pre-extracted JNI header files from Eclipse Adoptium builds, ready to use in your C/C++ projects without needing a full JDK installed. Since all platform-specific headers are included, this is especially useful for cross-compilation builds where the target JDK may not be available on the host machine.
- Java 8
- Java 11
- Java 17
- Java 21
- Java 25
Each version includes the platform-independent headers (jni.h, jvmti.h, etc.) along with platform-specific subdirectories (linux/, win32/, darwin/).
Clone this repo (or add it as a submodule) into your project's include directory:
git clone --depth=1 https://github.com/Casterlabs/jni-headers.git include/jniOr as a Git submodule:
git submodule add https://github.com/Casterlabs/jni-headers.git include/jnigcc -I include/jni/versions/17/include \
-I include/jni/versions/17/include/linux \
-shared -o libmyjni.so myjni.cgcc -I include/jni/versions/17/include \
-I include/jni/versions/17/include/darwin \
-shared -o libmyjni.dylib myjni.ccl /I include\jni\versions\17\include ^
/I include\jni\versions\17\include\win32 ^
/LD myjni.c /Fe:myjni.dllTo regenerate the headers from the latest Adoptium releases:
npm install
npm run generateThe JDK header files are subject to the GPLv2 with Classpath Exception license. See the NOTICE and/or LICENSE files in each version directory for details.