Uploaded image for project: 'Apache Knox'
  1. Apache Knox
  2. KNOX-3024

Fix findJava in knox-functions.sh

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 1.4.0, 1.5.0, 2.0.0, 1.6.0, 1.6.1, 1.6.2
    • 2.1.0
    • Release
    • None

    Description

      5 years ago, when I added shellcheck support to our build in the scope of KNOX-1816, I introduced a bug in the findJava function in knox-functions.sh: when $JAVA_HOME is not set, and Java is not available on the path, the function tries to find java executables under /usr. However, the current implementation is wrong:

      $ which java
      /usr/bin/which: no java in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)
      $ echo $JAVA_HOME
      
      $ bin/knoxcli.sh export-cert --type JKS
      Warning: JAVA is not set and could not be found.
      ...  

      Attachments

        Activity

          People

            smolnar Sandor Molnar
            smolnar Sandor Molnar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h 10m
                1h 10m