nifi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aldrin Piri <aldrinp...@gmail.com>
Subject Re: JAVA_HOME trouble in nifi.sh
Date Fri, 13 Oct 2017 14:24:48 GMT
Can't say I've seen this before and certainly have JAVA_HOME set on most of
the places where I've performed builds.  Would you mind please opening up a
ticket as well as capturing the salient environmental bits (OS, Maven, JDK
versions, etc)?

That locateJava blurb is something we used from another ASF project and use
heavily throughout our executables, so definitely need to track it down.

Did you happen to see this substitution in any other files?

On Thu, Oct 12, 2017 at 10:51 PM, Peter Wicks (pwicks) <pwicks@micron.com>
wrote:

> Only when building on Linux, during build my "${JAVA_HOME}" string in
> nifi.sh is getting overwritten by the current value of my environment
> variable for JAVA_HOME on my build box... not sure if this is something
> others have run into.
>
> I built on one box, where JAVA_HOME is set to
> "/var/spe/tools/jdk1.8.0_144". I then copied the tar.gz directly from
> nifi-assembly to another box. I only extracted it after getting to the
> other server where JAVA_HOME is not set.
>
> Here is a snippet from nifi.sh, I've bolded the sections where the raw
> file has ${JAVA_HOME}. Mabye this is a system config issue? Obviously this
> isn't happening for everyone else building on Linux...?
>
> locateJava() {
>     # Setup the Java Virtual Machine
>     if $cygwin ; then
>         [ -n "${JAVA}" ] && JAVA=$(cygpath --unix "${JAVA}")
>         [ -n "/var/spe/tools/jdk1.8.0_144" ] && JAVA_HOME=$(cygpath --unix
> "/var/spe/tools/jdk1.8.0_144")
>     fi
>
>     if [ "x${JAVA}" = "x" ] && [ -r /etc/gentoo-release ] ; then
>         JAVA_HOME=$(java-config --jre-home)
>     fi
>     if [ "x${JAVA}" = "x" ]; then
>         if [ "x/var/spe/tools/jdk1.8.0_144" != "x" ]; then
>             if [ ! -d "/var/spe/tools/jdk1.8.0_144" ]; then
>                 die "JAVA_HOME is not valid: /var/spe/tools/jdk1.8.0_144"
>             fi
>             JAVA="/var/spe/tools/jdk1.8.0_144/bin/java"
>         else
>             warn "JAVA_HOME not set; results may vary"
>             JAVA=$(type java)
>             JAVA=$(expr "${JAVA}" : '.* \(/.*\)$')
>             if [ "x${JAVA}" = "x" ]; then
>                 die "java command not found"
>             fi
>         fi
>     fi
>     # if command is env, attempt to add more to the classpath
>     if [ "$1" = "env" ]; then
>         [ "x${TOOLS_JAR}" =  "x" ] && [ -n "/var/spe/tools/jdk1.8.0_144" ]
> && TOOLS_JAR=$(find -H "/var/spe/tools/jdk1.8.0_144" -name "tools.jar")
>         [ "x${TOOLS_JAR}" =  "x" ] && [ -n "/var/spe/tools/jdk1.8.0_144" ]
> && TOOLS_JAR=$(find -H "/var/spe/tools/jdk1.8.0_144" -name "classes.jar")
>         if [ "x${TOOLS_JAR}" =  "x" ]; then
>              warn "Could not locate tools.jar or classes.jar. Please set
> manually to avail all command features."
>         fi
>     fi
>
> }
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message