Good evening. I downloaded NiFi 1.3.0 to a linux EC2 instance in AWS I
recently created. A uname -or tells me the version of Linux I am
running: 4.9.20-11.31.amzn1.x86_64 GNU/Linux
I tried to establish nifi as a service. I was the root user - not the nifi
user - I changed to the bin directory of my nifi installation and ran
./nifi.sh install
I got this small /etc/init.d/nifi file:
NIFI_HOME=/local/opt/nifi/nifi-1.3.0
bin_dir=${NIFI_HOME}/bin
nifi_executable=${bin_dir}/nifi.sh
${nifi_executable} "$@"
I then executed
service nifi start
I expected the service to start owned by user nifi, because in my
bootstrap.conf file I set
run.as=nifi
It never started. I got this error:
[root@ip-10-0-0-21 init.d]# service nifi start
nifi.sh: JAVA_HOME not set; results may vary
Java home:
NiFi home: /local/opt/nifi/nifi-1.3.0
Bootstrap Config File: /local/opt/nifi/nifi-1.3.0/conf/bootstrap.conf
Exception in thread "main" java.lang.UnsupportedClassVersionError:
org/apache/nifi/bootstrap/RunNiFi : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:803)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:442)
at java.net.URLClassLoader.access$100(URLClassLoader.java:64)
at java.net.URLClassLoader$1.run(URLClassLoader.java:354)
at java.net.URLClassLoader$1.run(URLClassLoader.java:348)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:347)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at
sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
I tried to determine what version of java, and this is what I learned:
[root@ip-10-0-0-21 init.d]# which java
/usr/bin/java
[root@ip-10-0-0-21 init.d]# ls -tl /usr/bin/java
lrwxrwxrwx 1 root root 22 Apr 17 07:58 /usr/bin/java ->
/etc/alternatives/java
[root@ip-10-0-0-21 init.d]# ls -tl /etc/alternatives/java
lrwxrwxrwx 1 root root 46 Apr 17 07:58 /etc/alternatives/java ->
/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
[root@ip-10-0-0-21 init.d]# uname -or
4.9.20-11.31.amzn1.x86_64 GNU/Linux
[root@ip-10-0-0-21 init.d]#
As user nifi, I try to determine my java version but it cannot find javac:
[nifi@ip-10-0-0-21 conf]$ javac -version
bash: javac: command not found
I started an EC2 that is supposed to have java on it but evidently it must
not.
So my questions:
* has anyone conquered this problem, and if so can you offer any guidance?
* Does that jre-1.7.0 mean I am doomed from the start here because NiFi
1.3.0 requires java 8?
* should I run the run/sh install to set up as a service as root?
Thank you in advance for any help.-Jim