Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-8583

Linux service script ignores JAVA_HOME when default JAVA is found

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Duplicate
    • Affects Version/s: 4.2.2
    • Fix Version/s: 4.3.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      Linux

      Description

      Hi,

      When I have multiple Java versions are installed on a Linux server, it will always use the default Java and not the one specified in JAVA_HOME. The service script shoudl respect the setting from the default file and not use the default unless JAVA_HOME is not set. Because of this issue Artifactory can't be run on a host with Java 7 as the default (or the service script has to be changed).

      This seems to be the related part of the Artifactory service script (misc/service/artifactory):
      if type -p java; then
      _java=java
      elif [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then
      echo found java executable in JAVA_HOME
      _java="$JAVA_HOME/bin/java"
      else
      echo "no java"
      fi

      This should be:
      if [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then
      echo found java executable in JAVA_HOME
      _java="$JAVA_HOME/bin/java"
      elif type -p java; then
      _java=java
      else
      echo "no java"
      fi

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                johan.vliek Johan-Kees Vliek
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: