Error: No rule to make target 'jni.h', needed by 'build/NativeBoot.o'

Getting error while installing hail on cluster

I have set my JAVA_HOME as

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre/

Installation steps:

apt-get update -y
apt-get install \
    openjdk-8-jdk-headless \
    g++ \
    python3 python3-pip \
    libopenblas-dev liblapack-dev \
    liblz4-dev -y

git clone https://github.com/hail-is/hail.git
cd hail && git checkout 0.2.72 && cd hail
make install-on-cluster HAIL_COMPILE_NATIVES=1 SCALA_VERSION=2.12.13 SPARK_VERSION=3.2.0

Error trace:

2022-02-22 01:17:47 make[1]: Leaving directory '/home/dnanexus/hail/hail/src/main/c'
2022-02-22 01:17:47 make[1]: *** No rule to make target 'jni.h', needed by 'build/NativeBoot.o'.  Stop.
2022-02-22 01:17:47 make: *** [Makefile:374: native-lib-prebuilt] Error 2

PS: I did checkout this thread: Link

Context: I am creating a custom spark cluster on DNANexus RAP.

Hi Abhishek,

Pretty sure your problem is that you have JAVA_HOME set incorrectly. It needs to point to the “jdk” (Java Development Kit), not the “jre” (Java Runtime Environment).

1 Like

Yes, I found that my JAVA_HOME was not correctly set because I only installed jre.
So, I added the steps mentioned in hail documentation

apt-get update -y
apt-get install \
    openjdk-8-jdk-headless \
    g++ \
    python3 python3-pip \
    libopenblas-dev liblapack-dev \
    liblz4-dev \
    rsync -y

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

HAIL_VERSION=0.2.78

# Build Hail
# Following https://hail.is/docs/0.2/install/other-cluster.html
mkdir -p /builds
cd /builds
git clone https://github.com/hail-is/hail.git
cd hail/hail
git checkout $HAIL_VERSION

make install-on-cluster HAIL_COMPILE_NATIVES=1 SCALA_VERSION=2.11.12 SPARK_VERSION=2.4.4 HAIL_PYTHON3=python3

Earlier my JAVA_HOME was set to
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre

I had to reset it to export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64.

2 Likes