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

Hi all,

I got snagged by this too. NB that the 0.2 dev installation instructions (Hail | For Software Developers) refer you to the installation requirements for the end-user installation (Hail | Install Hail on GNU/Linux), which have you install openjdk-8-jre-headless, but apparently not the JDK per se. In that case, it seems that the path /usr/lib/jvm/java-8-openjdk-amd64 is present but exporting it as JAVA_HOME doesn’t suffice to install.

In any case, I was able to resolve it with:

sudo apt-get install openjdk-11-jdk
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64

The docs might benefit from including language to that effect.

Thanks!

Thanks for the report! The next release of the docs will clarify the need for the JDK.

1 Like