bbopt / nomad

NOMAD - A blackbox optimization software
https://nomad-4-user-guide.readthedocs.io/
GNU Lesser General Public License v3.0
114 stars 24 forks source link

Java interface error for INCLUDE PATH when configuring #83

Open ctribes opened 2 years ago

ctribes commented 2 years ago

When enabling Java interface building with Swig (for example with command cmake -DBUILD_INTERFACE_JAVA=ON -S . -B build/release), the following type of error is obtained:

CMake Error at /opt/homebrew/Cellar/cmake/3.22.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)

To fix this, uncomment the lines and make sure that the path to JNI include directories are correct.

   #set(JAVA_INCLUDE_PATH "$ENV{JAVA_HOME}/Contents/Home/include")
   #set(JAVA_INCLUDE_PATH2 "$ENV{JAVA_HOME}/Contents/Home/include")
   #set(JAVA_AWT_INCLUDE_PATH "$ENV{JAVA_HOME}/Contents/Home/include")

in root CMakeLists.txt. The environment variable $JAVA_HOME must also be properly set.