`fatal error: jni.h: No such file or directory` when building aGrUM with java bindings on Fedora
I attempt to build aGrUM enabling the option of java bindings on Fedora, the fatal error: jni.h: No such file or directory
appeared.
[506/510] /usr/bin/g++ -DjAgrum_EXPORTS -I/builddir/build/BUILD/aGrUM-1.8.3/wrappers/jAgrum -I/builddir/build/BUILD/aGrUM-1.8.3/src -I/builddir/build/BUILD/aGrUM-1.8.3/redhat-linux-build -fopenmp -DGUM_FOR_SWIG -Wall -pedantic -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -DNDEBUG -std=gnu++20 -fPIC -MD -MT wrappers/jAgrum/CMakeFiles/jAgrum.dir/lib/jAgrumJAVA_wrap.cxx.o -MF wrappers/jAgrum/CMakeFiles/jAgrum.dir/lib/jAgrumJAVA_wrap.cxx.o.d -o wrappers/jAgrum/CMakeFiles/jAgrum.dir/lib/jAgrumJAVA_wrap.cxx.o -c /builddir/build/BUILD/aGrUM-1.8.3/redhat-linux-build/wrappers/jAgrum/lib/jAgrumJAVA_wrap.cxx
FAILED: wrappers/jAgrum/CMakeFiles/jAgrum.dir/lib/jAgrumJAVA_wrap.cxx.o
/usr/bin/g++ -DjAgrum_EXPORTS -I/builddir/build/BUILD/aGrUM-1.8.3/wrappers/jAgrum -I/builddir/build/BUILD/aGrUM-1.8.3/src -I/builddir/build/BUILD/aGrUM-1.8.3/redhat-linux-build -fopenmp -DGUM_FOR_SWIG -Wall -pedantic -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -DNDEBUG -std=gnu++20 -fPIC -MD -MT wrappers/jAgrum/CMakeFiles/jAgrum.dir/lib/jAgrumJAVA_wrap.cxx.o -MF wrappers/jAgrum/CMakeFiles/jAgrum.dir/lib/jAgrumJAVA_wrap.cxx.o.d -o wrappers/jAgrum/CMakeFiles/jAgrum.dir/lib/jAgrumJAVA_wrap.cxx.o -c /builddir/build/BUILD/aGrUM-1.8.3/redhat-linux-build/wrappers/jAgrum/lib/jAgrumJAVA_wrap.cxx
/builddir/build/BUILD/aGrUM-1.8.3/redhat-linux-build/wrappers/jAgrum/lib/jAgrumJAVA_wrap.cxx:138:10: fatal error: jni.h: No such file or directory
138 | #include <jni.h>
| ^~~~~~~
compilation terminated.
But cmake log showed it found JNI
-- Found Python: /usr/bin/python3.11 (found version "3.11.4") found components: Interpreter Development.Module
-- ================================
-- python version : 3.11.4
-- python installation : lib64/python3.11/site-packages
-- python include : /usr/include/python3.11
-- python library :
-- ================================
-- ** act Notification: updating requirements.txt in /builddir/build/BUILD/aGrUM-1.8.3/wrappers/pyAgrum/../../binder
-- ** act Notification: updating requirements.txt in /builddir/build/BUILD/aGrUM-1.8.3/wrappers/pyAgrum/doc/sphinx
-- ** act Notification: updating requirements.txt in /builddir/build/BUILD/aGrUM-1.8.3/wrappers/pyAgrum/doc/sphinx/notebooks
-- ** act Notification: updating requirements.txt in /builddir/build/BUILD/aGrUM-1.8.3/wrappers/pyAgrum/testunits
-- Found JNI: /usr/lib/jvm/java/include found components: AWT JVM
CMake Deprecation Warning at /usr/share/cmake/Modules/UseSWIG.cmake:768 (message):
SWIG_ADD_MODULE is deprecated. Use SWIG_ADD_LIBRARY instead.
Call Stack (most recent call first):
wrappers/jAgrum/CMakeLists.txt:16 (swig_add_module)
-- Configuring done (5.8s)
-- Generating done (0.1s)
Build log: https://kojipkgs.fedoraproject.org/work/tasks/4771/102504771/build.log