Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

JAVA_HOME not set; results may vary - no solution found

Solved Go to solution
Highlighted

JAVA_HOME not set; results may vary - no solution found

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

Accepted Solutions
Highlighted

Re: JAVA_HOME not set; results may vary - no solution found

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
Highlighted

Re: JAVA_HOME not set; results may vary - no solution found

Cloudera Employee

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. 

Highlighted

Re: JAVA_HOME not set; results may vary - no solution found

Explorer

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

View solution in original post

Highlighted

Re: JAVA_HOME not set; results may vary - no solution found

@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

 


 


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

Re: JAVA_HOME not set; results may vary - no solution found

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?

Don't have an account?
Coming from Hortonworks? Activate your account here