'JAVA_HOME is not valid when trying to start NIFI
Running on a mac. Just downloaded JAVA 1.8.0_311 in order to run nifi 1.14.0. I am following instructions from a book that instructs me to set the environment variable like so.
export JAVA_HOME=/usr/lib/jvm/java11-openjdk-amd64
when I do this I get a nifi message saying the path is invalid. The book is a year old so the examples may be a little outdated. I am trying to teach myself so I have some basic questions, and nifi documentation doesn't seem to have any input for JAVA_HOME.
How do I determine what the JAVA_HOME variable is supposed to be? I have seen others mention that the variable needs to point to bin
or jdk
but I'm not grasping why or how.
Any help would be appreciated
Solution 1:[1]
From the comments I was able to piece together the following path and saved it in /.bash_profile
:
/Library/Java/JavaVirtualMachines/jdk-17.0.1.jdk/Contents/Home
Solution 2:[2]
Accordingly with "Data Engineering with Python. Work with massive datasets to design data models and automate data pipelines using Python" from Packt Publishing (2020):
you should edit .bash_profile to include the following line so that NiFi can find the JAVA_HOME variable:
export JAVA_HOME=/usr/lib/jvm/java11-openjdk-amd64
- Lastly, reload .bash_profile:
source .bash_profile
Open a terminal, type:
dirname $(dirname $(readlink -f $(which javac)))
Copy the path, then open another terminal and type (using nano editor):
nano ~/.bash_profile
Then paste the path next to JAVA_HOME variable:
export JAVA_HOME=/usr/lib/jvm/java11-openjdk-amd64
Ctrl-O, Enter, Ctrl-X, to exit nano editor.
Last, type, in the last terminal:
source ~/.bash_profile
Reboot system
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Ruli |
Solution 2 | procrastinator |