Relax the requirements to set the JAVA_HOME for startup scripts

XMLWordPrintable

    • Type: Bug
    • Resolution: Low Engagement
    • Priority: Low
    • None
    • Affects Version/s: 5.0.0
    • Component/s: None
    • 1
    • Severity 3 - Minor
    • 0

      With 5.0 we have changed the startup scripts and extended it with requirement to set JAVA_HOME or JRE_HOME env. variables. These variables are not set always by default in Linux distributions. I've tested Ubuntu 16.04 with OpenJDK (1.8.0_121-8u121-b13-0ubuntu1.16.04.2-b13) and the env variables are not set. This is working fine with 4.14 but after upgrade to 5.0 it requires the env. variable to be set.

      Previously we have catered for this - see java_type=$(type -p java) in the following snippet:

       if [ -n "$JAVA_HOME" ]; then
              # invalid JAVA_HOME set
              echo "-------------------------------------------------------------------------------"
              echo "  JAVA_HOME \"$JAVA_HOME\" does not point to a valid Java home directory."
              echo "-------------------------------------------------------------------------------"
          else
              # JAVA_HOME not set
              java_type=$(type -p java)
              if [ -n java_type ]; then
                  # java is in PATH
                  JAVA_BINARY=java
              fi
          fi
       

      This was done in set-java-home.sh. As this might look like a regression from customer point of view, I think we should fix it and relax the constraint. I don't think it is actually bringing us some real benefits.

            Assignee:
            Unassigned
            Reporter:
            Adam Brokes
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: