skip to Main Content

I am using Linux aarch64 machine. I use miniconda3 and create a virtual environment in miniconda3. I want to install tensorflow using bazel. Therefore I first download the bazel zip file.

When I run the compile.sh file after extracting the zip file of "bazel", I got the following error

INFO: You can skip this first step by providing a path to the bazel binary as second argument:
INFO:    ./compile.sh compile /path/to/bazel
🍃  Building Bazel from scratch
ERROR: Cannot determine JDK version, please set $JAVA_HOME.n $JAVAC_VERSION is "javac 11.0.16"

When I search Java version ,
java --version
I got this

openjdk version "11.0.16" 2022-07-19
OpenJDK Runtime Environment (build 11.0.16+8-post-Ubuntu-0ubuntu120.04)
OpenJDK 64-Bit Server VM (build 11.0.16+8-post-Ubuntu-0ubuntu120.04, mixed mode)

May I know how can I solve the issue?
When I check echo $JAVA_HOME", I got nothing. Do I also need to set JAVAC_VERSION? If yes, may I know how can I set both Java_home and javac_version?
Thank you.

3

Answers


  1. Chosen as BEST ANSWER

    Thank you @Philip for your input and advice.

    The issue is solved by:

    1. ls -l /etc/alternatives/java gives etc/alternatives/java -> /usr/lib/jvm/java-11-openjdk-arm64/

    2. vim /etc/profile

    3. Press I

    4. Add

      export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-arm64/bin/java
      
      export PATH=$JAVA_HOME/bin:$PATH
      
    5. Reboot the os. source /etc/profile


  2. Try to set up an Environment Variable. Google "how to install JDK 8." You can get better answers there

    Login or Signup to reply.
  3. It seems like you didn’t set JAVA_HOME environment variable

    Please check here to manually setup environment variables.

    Here you should set export JAVA_HOME=<java_path>

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search