I’ve been following the documentation step by step and have been repeated tripped up at the ‘mvn package’ step where errors prevent me from installing xboost4j completely. For reference, I’m running Java 1.8.0_212, Maven 3.6.1, and the latest version of CMake downloaded from the cmake site on a Mac with OS X 10.11.6. Now there’s a set of errors that I’ve been running into, that I’m going to post below in order:
[ 98%] Building CXX object jvm-packages/CMakeFiles/xgboost4j.dir/xgboost4j/src/native/xgboost4j.cpp.o
In file included from /Users/bill/Desktop/xgboost/jvm-packages/xgboost4j/src/native/xgboost4j.cpp:20:
/Users/bill/Desktop/xgboost/jvm-packages/xgboost4j/src/native/./xgboost4j.h:2:10: fatal error: ‘jni.h’ file not found
1 error generated.
make: *** [jvm-packages/CMakeFiles/xgboost4j.dir/xgboost4j/src/native/xgboost4j.cpp.o] Error 1
make: *** [jvm-packages/CMakeFiles/xgboost4j.dir/all] Error 2
make: *** [all] Error 2
building Java wrapper
mkdir -p build
Traceback (most recent call last):
File “create_jni.py”, line 93, in
run(“cmake --build . --config Release” + maybe_parallel_build)
File “create_jni.py”, line 51, in run
cmake … -DUSE_S3:BOOL=OFF -DUSE_OPENMP:BOOL=OFF -DUSE_CUDA:BOOL=OFF -DUSE_AZURE:BOOL=OFF -DUSE_HDFS:BOOL=OFF -DJVM_BINDINGS:BOOL=ON
subprocess.check_call(command, shell=True, **kwargs)
cmake --build . --config Release
File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py”, line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘cmake --build . --config Release’ returned non-zero exit status 2
[ERROR] Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
Now I’ve made sure that my $JAVA_HOME is correctly set up and that both Java and Maven are in my PATH, and manually checked for the jni.h file within the include subfolder of $JAVA_HOME to make sure it is there. I’ve tried running mvn with and without sudo. I’ve put the correct CC and CXX tags within config.mk . I can’t tell if this is a jni.h/$JAVA_HOME issue or if there’s something with my cmake that’s making these errors happen because both errors appear. And I’m not sure how to resolve either of these issues. Could someone shed some insight or point me in the right direction?