beagle-dev / beagle-lib

general purpose library for evaluating the likelihood of sequence evolution on trees
MIT License
131 stars 57 forks source link

Could NOT find JNI #220

Open brmagalis opened 4 months ago

brmagalis commented 4 months ago

I am attempting to install Beagle on a Mac M3 using source install, and I am receiving the following error:

(base) brittanyrifemagalis@MacBook-Pro ~ % git clone --depth=1 https://github.com/beagle-dev/beagle-lib.git Cloning into 'beagle-lib'... remote: Enumerating objects: 289, done. remote: Counting objects: 100% (289/289), done. remote: Compressing objects: 100% (240/240), done. remote: Total 289 (delta 91), reused 137 (delta 36), pack-reused 0 Receiving objects: 100% (289/289), 2.80 MiB | 9.47 MiB/s, done. Resolving deltas: 100% (91/91), done. (base) brittanyrifemagalis@MacBook-Pro ~ % cd beagle-lib (base) brittanyrifemagalis@MacBook-Pro beagle-lib % mkdir build (base) brittanyrifemagalis@MacBook-Pro beagle-lib % cd build (base) brittanyrifemagalis@MacBook-Pro build % cmake .. -- The C compiler identification is AppleClang 15.0.0.15000309 -- The CXX compiler identification is AppleClang 15.0.0.15000309 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- BEAGLE_VERSION = 4.0.1 -- BEAGLE_PLUGIN_VERSION = 40 xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance -- Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 AWT) CMake Error at CMakeLists.txt:76 (message): No JNI includes and libraries found

xji3 commented 4 months ago

@brmagalis Do you have JDK installed on your computer? You could setup environment variable JAVA_HOME to the JDK home. I am using azul zulu for arm build (https://www.azul.com/downloads/?package=jdk#zulu) and I set my JAVA_HOME by export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-20.jdk/contents/Home. It seems that the newest version is 22 now, so you probably need to double check and edit the path to fit yours.

brmagalis commented 4 months ago

So, I installed jdk and set the JAVA_HOME variable, but I am still having the same issue:

(base) brittanyrifemagalis@MacBook-Pro build % cmake ..
-- BEAGLE_VERSION = 4.0.1 -- BEAGLE_PLUGIN_VERSION = 40 xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance -- Could NOT find JNI (missing: JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 AWT) CMake Error at CMakeLists.txt:76 (message): No JNI includes and libraries found

-- Configuring incomplete, errors occurred! (base) brittanyrifemagalis@MacBook-Pro build % echo $JAVA_HOME /Library/Java/JavaVirtualMachines/jdk-22.jdk/Contents/Home