-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.UnsatisfiedLinkError: no themis_jni in java.library.path: [C:\Users\me\Downloads\jdk-11.0.1\bin on Windows #897
Comments
JavaThemis calls Does renaming Another thing that might be wrong here is that JNI DLL might be not self-sufficient. On Windows, Themis builds itself for MSYS2 environment and expects a bunch of MSYS DLLs to be loaded along with it. I don't remember off the top of my head the exact way to list dependencies of a DLL, but you'd might to do that as well and copy over extra libraries. |
Hello @ilammy, I have tried renaming "libthemis_jni.dll" to "themis_jni.dll" and "themis_jni" and the application got another error instead.
For other dependency, I have copied all from "/usr/local/lib" and many other location and stored it inside "themis/some-path/docs/example/java/libs". Here is the tree structure of all the files I have as the dependency: bin:
include:
lib:
I have also set dependency directory inside build.gradle of the app:
And lastly, specify "-Djava.library.path" inside Intellij JVM args to "themis/some-path/docs/example/java/libs". But, sadly, it still doesn't work. |
I'm not a Windows user, but the googling of "finished with non-zero exit value -1073741819" lead me to different results. For example, here (the guide is targeted on end users, not developers) they believe that the issue is related to file access. Here people complain on Android SDK build tools. @VisionaryAppDev could you tell us more which Windows version do you use (version, is it 32-bit of 64-bit)? |
The exit code is for “access violation” error, which suggests that the issue here runs deeper. Rereading your message, I believe the issue here might be in mixing JDKs. JNI libraries are DLLs but they are not completely self-sufficient and compatible, even on the same OS. That's even not considering the differences between JDK versions. If a DLL is built with MSYS2 GCC compiler to be loaded in MSYS2 environment – it might not be compatible with DLLs built by MSVC, which is what Windows JRE might expect. While it looks like a 64-bit DLL, functions might be using different calling conventions, which ultimately leads to a failure. Sadly, at the moment, Windows support is still experimental not really actively worked on, so I don't have any more quick suggestions to try. From what it appears, in order to build |
Hello @vixentael , I have x64 bit JDK installed on my PC. And everything such as Intellij, Webstorm, and something like dbeaver are working pretty well. |
Thank you, @ilammy for your lengthy explanation. Seem like it is a lot complicated on Windows than on Linux and Mac OS. Maybe I could consider trying again the future or request my team to look into Linux instead. |
Hello Everyone,
Currently, I have tried installing Themis from source and most of the process is going pretty well but still there is some problem I got so far.
First, I have Themis core installed by following this tutorial without any problem on Windows. tutorial
Then, I have tried installing Themis language wrapper for Java and then thing start to get intent. The thing I noticed is that, JAVA_HOME must point to Linux JDK in other to make this
make themis_jni
build command run successfully. If I set my JAVA_HOME to Windows JDK, then there is some problem related to jni.h being missing.Currently, I have tried setting JAVA_HOME to Linux JDK and
make themis_jni
build command is producing a few files:And for
make themis_jni_install
command, I also get some success output as well:Ok, after everything is done, I have copied
libthemis_jni.dll
into ../JDK/bin/ directory and run the example project. Since I am using Intellij, I have set the JVM Args to-Djava.library.path="full-path-of-jdk/bin"
After run, I got some error:
Please let me know if I did some wrong here. Thanks
The text was updated successfully, but these errors were encountered: