Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-7161

Bootstrap's handling of JAVA_HOME needs improvement

    XMLWordPrintableJSON

Details

    • ghx-label-1

    Description

      bin/bootstrap_system.sh installs the Java SDK and sets JAVA_HOME in the current shell. It also adds a command to the bin/impala-config-local.sh to export JAVA_HOME there. This doesn't do the job.

      bin/impala-config.sh tests for JAVA_HOME at the very start of the script, before it has sourced bin/impala-config-local.sh. So, the user doesn't have a way of developing over the long term without manually setting up JAVA_HOME.

      bin/impala-config.sh also doesn't detect the system JAVA_HOME. For Ubuntu 16.04, this is fairly simple and if a developer has their system JDK set up appropriately, it would make sense to use it. For example:

       

      # If javac exists, then the system has a Java SDK (JRE does not have javac).
      # Follow the symbolic links and use this to determine the system's JAVA_HOME.
      if [ -L /usr/bin/javac ]; then
        SYSTEM_JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:bin/javac::")
      fi
      
      export JAVA_HOME="${JAVA_HOME:-${SYSTEM_JAVA_HOME}}"

       

      Attachments

        Activity

          People

            joemcdonnell Joe McDonnell
            joemcdonnell Joe McDonnell
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: