Support Questions

Find answers, ask questions, and share your expertise

JAVA_HOME not set; results may vary - no solution found

avatar
Explorer

If I do echo $JAVA_HOME I get /usr/lib/jvm/java-8-openjdk-amd64 as a response, yet I cannot get nifi to see it when it starts, always gives this:

nifi.sh: JAVA_HOME not set; results may vary

Java home:

NiFi home: /opt/nifi-1.12.0

 

This is on a clean Ubuntu 18.04 installation, having followed these instructions: https://techexpert.tips/apache-nifi/apache-nifi-installation-ubuntu-linux/

At this point really not sure what to do.

1 ACCEPTED SOLUTION

avatar
Explorer

you may set JAVA_HOME in  'nifi-env.sh' which in the same dir with 'nifi.sh'

View solution in original post

4 REPLIES 4

avatar
Expert Contributor

If you define JAVA_HOME in your environment, then you must use the command:
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
And then the script will pick it up from your environment. Also please check if nifi bootstrap.conf file is configured properly. 

avatar
Explorer

you may set JAVA_HOME in  'nifi-env.sh' which in the same dir with 'nifi.sh'

avatar
Super Guru

@Tokolosk JAVA_HOME is not required for nifi to operate.

[root@c7401 nifi-1.12.0]# ./bin/nifi.sh start
nifi.sh: JAVA_HOME not set; results may vary

Java home: 
NiFi home: /root/nifi-1.12.0

Bootstrap Config File: /root/nifi-1.12.0/conf/bootstrap.conf

 

The only commands in my node are (not ubuntu but should be similar):

yum install java java-devel
wget http://apache.mirrors.hoobly.com/nifi/1.12.0/nifi-1.12.0-bin.zip
unzip nifi-1.12.0-bin.zip
cd nifi-1.12.0
./bin/nifi.sh start
tail -f logs/nifi-app.log
....

2020-09-25 12:15:14,828 INFO [main] org.apache.nifi.web.server.JettyServer NiFi has started. The UI is available at the following URLs: 2020-09-25 12:15:14,828 INFO [main] org.apache.nifi.web.server.JettyServer http://192.168.74.101:8080/nifi 2020-09-25 12:15:14,828 INFO [main] org.apache.nifi.web.server.JettyServer http://10.0.2.15:8080/nifi 2020-09-25 12:15:14,828 INFO [main] org.apache.nifi.web.server.JettyServer http://127.0.0.1:8080/nifi

If you are having problems, be sure to tail logs/nifi-app.log and look for errors.

 

If this answer resolves your issue or allows you to move forward, please choose to ACCEPT this solution and close this topic. If you have further dialogue on this topic please comment here or feel free to private message me. If you have new questions related to your Use Case please create separate topic and feel free to tag me in your post.

 

Thanks,

Steven

avatar
Explorer

Hi Steven,

 

I used @bingo 's solution to get Nifi to find my JAVA_HOME.

 

But you mention that Nifi does not need this to run. Do you know what is the impact for running nifi without it knowing where Java is installed?