Closed ajinkya933 closed 5 years ago
The relevant error seems to be
/Users/ajinkyabobade/src/diplib/javaio/src/javaio.cpp:66:24: error: use of undeclared identifier 'JNI_VERSION_1_8' vm_args.version = JNI_VERSION_1_8;
Did you install JDK 1.8? (http://www.oracle.com/technetwork/java/javase/downloads/index.html). In theory, it shouldn't try to build JavaIO if not. Maybe it found the SDK but uses the wrong JNI version? Hopefully Cris should be able to help.
If you don't need JavaIO, you can configure with
cmake .. -DDIP_BUILD_JAVAIO=OFF
In any case, if would be a good idea to silence the OpenGL warnings by defining GL_SILENCE_DEPRECATION. I don't think it will be removed anytime soon. I'm a bit concerned about JNI being deprecated, though.
Yes, I received that error on MacOS when the version of JNI found by CMake was the one that comes installed by default, rather than the one that comes with JDK 1.8. You need to have JDK 1.8 installed, and add -DJAVA_HOME=<path to JDK 1.8>
to your CMake command.
In the CMake output, you will see two lines, one about the version of Java found, and one about the version of JNI found. These two should match.
Or, as Wouter suggested, you can disable JavaIO. This one is useful because it allows you to read many, many microscopy image formats. But you might have no need for it.
The long list of warnings are related to OpenGL:
first deprecated in macOS 10.14 - OpenGL API deprecated.
I haven't upgraded to Mojave jet (still on 10.13), so hadn't seen these. Apple has deprecated OpenGL, wants everyone to use Metal instead (this is the MacOS-only graphics API, just like Windows has DirectX). I hope they don't remove OpenGL any time soon. In the meantime, I'll add the GL_SILENCE_DEPRECATION
define to the compile options for MacOS.
I have java --version ==javac 11.0.1. Should I downgrade this to JDK 1.8
I don't think that is necessary, it looks like the JNI_VERSION_1_8
identifier should be defined in JDK 11.
I have seen this same error you are seeing. It happened when CMake found the JNI that comes with the JDK 1.6 that is shipped with MacOS, instead of the newer JDK that I installed from Oracle.
If you delete your CMakeCache.txt
file (in the directory where you ran the cmake
command), and run the cmake
command again, you should see two lines in the output like these:
-- Found Java: /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/bin/java (found suitable version "1.8.0.121", minimum required is "1.8") found components: Development
-- Found JNI: /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/libjawt.dylib
Yours will have 1.11 as the version found. But it is important that these two lines both point to the same JDK directory. When I had this error you are seeing, one of these two lines pointed to a JDK 1.6 directory. When I added -DJAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/
to the cmake
command, these two lines matched, and the compilation error went away.
Sorry, I didn't mean to close this, happened when I pushed what I hope is a solution.
Could you please pull the latest changes in the master branch, and see if your error goes away?
I changed the CMake configuration script so that the JNI found is always the one that corresponds to the Java found. This should basically ensure that the two lines in the output of CMake that I referred to above always match. There should no longer be a need to add the -DJAVA_HOME=...
argument to cmake
unless CMake is not at all able to find Java.
Let me know if this fixes your issue!
Thank you for making the change on GitHub now it works !!
Component Select one or more of: DIPlib, CMake build scripts. I am following https://github.com/DIPlib/diplib
Describe the bug I am following the instructions on https://github.com/DIPlib/diplib/blob/master/INSTALL_MacOS.md I am having trouble in the Building session
when I type
make -j check:
but when I try to install using:
make -j install
I get something like this:
I am attaching the complete report file so that you can get a better idea. report.txt How do I remove this error ?
System information: