I need the capabilities of CGAL for my java program. I am trying to run the java examples in order to get experience with CGAL binding.
I successfully built cgal-swig-bindings using cmake. I then copied the examples directory into my build directory and in the examples/java directory ran the test.sh file. Nothing compiled. Looking at test.sh, I realized that both the javac and java commands needed the
'-cp ../../build-java:.'
parameter. Now everything builds, but nothing runs. Java can not find the libraries. Java needed the
'-Djava.library.path=../../lib'
parameter. It still can not find the libraries. The code is looking for a library named libCGAL_Kernel.so, but cmake named the library libCGAL_Kernel_cpp.so. All the libraries had _cpp in their name, so I renamed them all. Now java can find the libraries, but the examples still do not run. I get errors like:
Exception in thread "main" java.lang.UnsatisfiedLinkError: CGAL.Kernel.CGAL_KernelJNI.new_Point_3__SWIG_2(DDD)J
at CGAL.Kernel.CGAL_KernelJNI.new_Point_3__SWIG_2(Native Method)
at CGAL.Kernel.Point_3.<init>(Point_3.java:47)
at simple_triangulation_3.main(simple_triangulation_3.java:16)
Running nm on libCGAL_Kernel.so, I do not see any symbol even similar to that in the error message.
I am running Fedora 26 with gcc (GCC) 7.3.1, java version "1.8.0_121", cmake version 3.11.0, SWIG Version 3.0.12. I installed CGAL using dnf (aka yum). The libraries are labelled version 11.0.0.
I do not understand what I am doing wrong. Any help will be greatly appreciated. Thank you.