Skip to content
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

OSX 10.10 + Java 8 issue loading native libraries #6

Closed
ffcsoftware opened this issue Oct 29, 2014 · 13 comments
Closed

OSX 10.10 + Java 8 issue loading native libraries #6

ffcsoftware opened this issue Oct 29, 2014 · 13 comments

Comments

@ffcsoftware
Copy link

I have an applet with JavaCV running fine in all operating systems (Win32, Win64, OSX 10.9, 10.8, 10.7) but recently I've detected the following error in OSX 10.10 (yosemite) running with Java8 (the only runtime available for this OSX version):

./libopencv_core.2.4.dylib: malformed mach-o image: load command #12 length (0) too small in ./libopencv_core.2.4.dylib
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1929)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1814)
    at java.lang.Runtime.load0(Runtime.java:809)
    at java.lang.System.load(System.java:1083)
    at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:524)
    ... 12 more

Anyone else with this problem? Any suggestion?

Thanks in advance!

@saudet
Copy link
Member

saudet commented Nov 1, 2014

Ok, I think I fixed that in this revision: bytedeco/javacpp-presets@e00c947

I've uploaded some binaries you can try here:
https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/javacpp-presets/

Let me know if that works! Thanks for reporting

@ffcsoftware
Copy link
Author

Hi!

I've tested the core & imgproc modules in OS X 10.10 and it seems to work now. I'll run more tests in previous version of iOS and I'll post again if something weird happens.

Thank you very much!

@CostantinoPerciante
Copy link

Hi,
I know it could be a stupid question but, how can I get those *.jars? I've the same problem with Yosemite and Javacv. From where can I download the new packages?

Thank you in advance

@saudet
Copy link
Member

saudet commented Nov 8, 2014

@Kevin50 Looks like the server has deleted them... Well, anyway, building it from source isn't hard on Linux or Mac, so please try to run cppbuild.sh install and mvn install as explained in the README.md file. Thanks!

@saudet
Copy link
Member

saudet commented Nov 9, 2014

FYI, I've uploaded another set of snapshots here:
https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/javacpp-presets/

@CostantinoPerciante
Copy link

Thank you man!! It works now :)

@bisher3
Copy link

bisher3 commented Nov 26, 2014

For the life of me I can't get JavaCV to work on Yosemite. I tried downloading the newer jars and substituting the old ones (ffmpeg and opencv) from the snapshot (which Kevin shared with me on stackoverflow). I tried downloading the JavaCV snapshot and javacpp and javacpp-presets also. I tried adding oss.sonatype.org/content/repositories/snapshots/org/bytedeco as a repository in a maven project and adding the dependencies from this repository only.
The project compiles and runs, but once I call grabber.start() it throws an error:
java.lang.NoClassDefFoundError: Could not initialize class org.bytedeco.javacpp.avutil

@saudet
Copy link
Member

saudet commented Dec 13, 2014

@bisher3 I've updated the SNAPSHOT binaries. Try them out, and let me know if you have any issues:
https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/
Thank you!

@bisher3
Copy link

bisher3 commented Dec 14, 2014

@saudet Thank you! Yes I tried them out and they are working correctly now.
For the reference this is what I did to get a project working on a Mac with OSX 10.10 (Yosemite)
Download the javacv-0.9.1-20140828.121539-1-bin.zip from here
https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/javacv/0.9.1-SNAPSHOT/
Download
ffmpeg-2.4.3-0.9.1-20141213.115041-1-macosx-x86_64.jar from:
https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/javacpp-presets/ffmpeg/2.4.3-0.9.1-SNAPSHOT/
and
opencv-2.4.10-0.9.1-20141213.115057-1-macosx-x86_64.jar
from
https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/javacpp-presets/opencv/2.4.10-0.9.1-SNAPSHOT/
Unpack the javacv zip file into a folder and copy the other two jar files to it.
I renamed the ffmpeg and opencv jars removing the build number (between -0.9 till macosx). This is probably uncessary but I did it anyway.
Go to your project and add javacv.jar ,javacpp.jar, opencv.jar, ffmpeg.jar, ffmpeg-2.4.3-macosx-x86_64.jar, opencv-2.4.10-macosx-x86_64.jar to your build path.
Clean and rebuild..
Thanks again.

@saudet
Copy link
Member

saudet commented Dec 27, 2014

Fixed binaries are included in version 0.10. Thanks for reporting!

@saudet saudet closed this as completed Dec 27, 2014
@Nonnis-M
Copy link

Nonnis-M commented Aug 1, 2015

It could be possible that the last version of complied libs is affected from the same issue? On Yosemite 10.10.3 I get the same error:
libopencv_core.2.4.dylib: malformed mach-o image: load command #12 length (0) too small in ...

I'm using the JavaCV 1.0 binary and sources archives.

@saudet
Copy link
Member

saudet commented Aug 1, 2015

@Nonnis-M JavaCV 1.0 doesn't link with OpenCV 2.4, so you're probably not using 1.0.

@Nonnis-M
Copy link

Nonnis-M commented Aug 2, 2015

I'm using the JavaCV 1.0 binary archive linked on the JavaCV README which use OpenCV 3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants