?
https://www.baeldung.com/jni
If I understand you correctly, no you can't. If you're writing cpp project and want to load java's dll, than it most probably wouldn't work since that dll is linked with java runtime library (it has "java.h" or "jni.h" includes, don't remember). But I'm not sure. Maybe you can somehow use utility functions (those that don't require "jni.h" functions) of java's dll. Haven't ever tried this, it is designed to work absolutely another way: java's dll should be loaded by running jvm that provides all those functions in "jni.h". Thus it was never intended to be used by native cpp/c program, only by running jvm
Also besides the JNI, you may consider https://github.com/java-native-access/jna
Обсуждают сегодня