-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
How do I resolve the java.lang.UnsatisfiedLinkError: no opencv_java455 in java.library.path error? #1754
Comments
Make sure |
@saudet I think that fixed the However, I am now getting a different I looked through this thread: #1435. I do not really understand it though. I already have |
Like I said, you'll need to call |
@saudet Thank you for the quick replies. Unfortunately, I do not think I am understanding correctly. Where should I call I have it as the first line of my main method: However, the
|
Call |
If you get an error on |
If you're trying to use the module path instead of the class path, which might be required by JavaFX, I believe this issue is still opened, yes, but that's a problem with JavaFX, not JavaCV. If you don't really care about using the class or modules paths, you can extract all the JAR files on your system, and set the java.library.path system property to where you extracted everything, and then |
Ah, ok. I think it is an issue with JavaFX then. For the JAR files, which ones do I need to extract? Would the |
Well, at least the "openblas" and "opencv" ones, since you're getting errors loading those, but if you get errors about loading other libraries, that means you'll need those as well! |
@saudet |
Duplicate of #1435 |
@johanvos Your Gradle plugin for JavaFX seems to be having issues as well... |
@saudet Thanks for letting me know. Our Gradle plugin (https://github.com/openjfx/javafx-gradle-plugin/) suffers from permanent changes in Gradle. It takes lots of time from us to maintain that plugin. @spectacularcrackers can you check if you have the same issue with maven? And perhaps file an issue on the javafx-{maven/gradle}-plugin? |
@johanvos BTW, Gradle apparently comes with module support since 7.0, most interestingly the inferModulePath property, see gradle/gradle#890 (comment). It might be worth dropping support for older versions of Gradle and restarting fresh from there. |
I'm not used to Gradle, but the reported exception is probably due to the native artifacts (
The JavaFX Maven plugin and its I don't know if the JavaFX Gradle plugin behaves similarly, but if it does not, you should either use Maven instead, like @johanvos said, or run your application yourself "manually", for instance by obtaining the dependencies from Gradle, and then run something like:
|
I have written a wiki page about JavaCPP and JavaFX cohabitation. It doesn't bring direct answers to this issue but tries to explain related things. |
I have read through the info docs here and also searched extensively on the internet but could not find a solution that works.
I am trying to create a javaFX application with gradle.
I am using this dependency in my gradle.build file: implementation group: 'org.bytedeco', name: 'javacv-platform', version: '1.5.7'
When I run
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
,Core.NATIVE_LIBRARY_NAME
returns the correct opencv version (opencv_java455). However,System.loadLibrary("opencv_java455")
fails with this error:java.lang.UnsatisfiedLinkError: no opencv_java455 in java.library.path:
What would be the correct way to go about resolving this?
From my digging online, I believe that I might be missing a .dylib file. However, I have no idea how to locate this file or how to point to it correctly. I do not see an opencv_java455.dylib file in the external libraries.
Thanks in advance for your help
Here is some more potentially useful information:
Operating system: MacOS Monterey
M1 chip Macbook pro
Using intelliJ
The text was updated successfully, but these errors were encountered: