[
https://issues.apache.org/jira/browse/NIFI-6584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16913842#comment-16913842
]
Aldrin Piri commented on NIFI-6584:
-----------------------------------
Hi [~bennyboi],
I do believe we make use of JAVA_HOME. The relevant section is here:
https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/bin/nifi.sh#L121-L155.
We have no static references to any files in that script. We do make a best
effort if all the normal avenues fail, but that outputs "JAVA_HOME not set;
results may vary" as shown at
https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/bin/nifi.sh#L138.
This does not seem to be evident in the log you shared with us. I do see you
are running nifi with sudo. Does `sudo jenv versions` also provide the
selected 1.8 version?
Anything in the shared section look amiss to you that we may be overlooking? I
know several folks in the community use jenv on a regular basis (inclusive of
myself) especially as we worked to provide support for building/running on Java
11.
> Recognize $JAVA_HOME changes via the Terminal
> ---------------------------------------------
>
> Key: NIFI-6584
> URL: https://issues.apache.org/jira/browse/NIFI-6584
> Project: Apache NiFi
> Issue Type: Improvement
> Environment: Distributor ID: Ubuntu
> Description: Ubuntu 18.04.3 LTS
> Release: 18.04
> Codename: bionic
> https://github.com/jenv/jenv
> Reporter: Ben Stuart
> Priority: Major
> Fix For: 1.9.1
>
>
> I've been notified NiFi dosen't support java11 yet and suspect that is the
> reason Nifi won't lunch.
> I am trying to get around this by using jenv.
> Having a look at the screenshot below you can see when I launch NiFi it
> believes the java home is still set to Java11.
> I suspected it's realted to this: [https://github.com/jenv/jenv/issues/224]
> in summary, I suspect NiFi is pointing to a full static path to the java file
> opposed to referencing $JAVA_HOME
> I'm hoping if this is the case, it can be improved to recognize the change
> better.
> {code:java}
> ben@ben-VirtualBox:~/Downloads/nifi-1.9.2$ jenv versions
> system
> 11.0
> 11.0.4
> * 1.8 (set by JENV_VERSION environment variable)
> 1.8.0.202
> openjdk64-11.0.4
> oracle64-1.8.0.202
> ben@ben-VirtualBox:~/Downloads/nifi-1.9.2$ java -version
> java version "1.8.0_202"
> Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
> Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)
> ben@ben-VirtualBox:~/Downloads/nifi-1.9.2/bin$ sudo ./nifi.sh run
> Java home: /usr/lib/jvm/java-11-openjdk-amd64
> NiFi home: /home/ben/Downloads/nifi-1.9.2
> Bootstrap Config File: /home/ben
> /Downloads/nifi-1.9.2/conf/bootstrap.conf2019-08-23 10:36:59,977 INFO [main]
> org.apache.nifi.bootstrap.Command Starting Apache NiFi...
> 2019-08-23 10:36:59,977 INFO [main] org.apache.nifi.bootstrap.Command Working
> Directory: /home/ben/Downloads/nifi-1.9.2
> 2019-08-23 10:36:59,977 INFO [main] org.apache.nifi.bootstrap.Command
> Command: /usr/lib/jvm/java-11-openjdk-amd64/bin/java -classpath
> /home/ben/Downloads/nifi-1.9.2/./conf:/home/ben/Downloads/nifi-1.9.2/./lib/nifi-runtime-1.9.2.jar:/home/ben/Downloads/nifi-1.9.2/./lib/nifi-framework-api-1.9.2.jar:/home/ben/Downloads/nifi-1.9.2/./lib/jcl-over-slf4j-1.7.25.jar:/home/ben/Downloads/nifi-1.9.2/./lib/slf4j-api-1.7.25.jar:/home/ben/Downloads/nifi-1.9.2/./lib/nifi-properties-1.9.2.jar:/home/ben/Downloads/nifi-1.9.2/./lib/log4j-over-slf4j-1.7.25.jar:/home/ben/Downloads/nifi-1.9.2/./lib/logback-core-1.2.3.jar:/home/ben/Downloads/nifi-1.9.2/./lib/javax.servlet-api-3.1.0.jar:/home/ben/Downloads/nifi-1.9.2/./lib/nifi-api-1.9.2.jar:/home/ben/Downloads/nifi-1.9.2/./lib/jetty-schemas-3.1.jar:/home/ben/Downloads/nifi-1.9.2/./lib/logback-classic-1.2.3.jar:/home/ben/Downloads/nifi-1.9.2/./lib/jul-to-slf4j-1.7.25.jar:/home/ben/Downloads/nifi-1.9.2/./lib/nifi-nar-utils-1.9.2.jar
> -Dorg.apache.jasper.compiler.disablejsr199=true -Xmx512m -Xms512m
> -Djavax.security.auth.useSubjectCredsOnly=true
> -Djava.security.egd=file:/dev/urandom
> -Dsun.net.http.allowRestrictedHeaders=true -Djava.net.preferIPv4Stack=true
> -Djava.awt.headless=true -Djava.protocol.handler.pkgs=sun.net.www.protocol
> -XX:+UseG1GC
> -Dnifi.properties.file.path=/home/ben/Downloads/nifi-1.9.2/./conf/nifi.properties
> -Dnifi.bootstrap.listen.port=35343 -Dapp=NiFi
> -Dorg.apache.nifi.bootstrap.config.log.dir=/home/ben/Downloads/nifi-1.9.2/logs
> --add-modules=java.xml.bind org.apache.nifi.NiFi
> WARNING: An illegal reflective access operation has occurred
> WARNING: Illegal reflective access by org.apache.nifi.bootstrap.util.OSUtils
> (file:/home/ben/Downloads/nifi-1.9.2/lib/bootstrap/nifi-bootstrap-1.9.2.jar)
> to method java.lang.ProcessImpl.pid()
> WARNING: Please consider reporting this to the maintainers of
> org.apache.nifi.bootstrap.util.OSUtils
> WARNING: Use --illegal-access=warn to enable warnings of further illegal
> reflective access operations
> WARNING: All illegal access operations will be denied in a future release
> 2019-08-23 10:36:59,992 INFO [main] org.apache.nifi.bootstrap.Command
> Launched Apache NiFi with Process ID 22931
> ben@ben-VirtualBox:~/Downloads/nifi-1.9.2/bin$
> {code}
>
--
This message was sent by Atlassian Jira
(v8.3.2#803003)