jtreg refuses to be run by openjdk

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P2
    • jtreg4.0
    • Affects Version/s: jtreg3.2.2_02
    • Component/s: tools
    • None
    • b02
    • generic, sparc
    • generic, linux, solaris_10

      The jtreg script (at least 3.2.2_02 for Linux) contains

      # Verify java version (1.)5 or newer used to run jtreg
      version=`"$JT_JAVA" -version 2>&1 |
              grep "java version" |
              sed -e 's/^[^"]*"\([^"]*\)".*/\1/' -e 's/^1\.//' -e 's/\([1-9][0-9]*\).*/\1/'`

      This expects that java -version prints a string beginning with "java version".
      But openjdk java prints "openjdk version..."

      The obvious fix is to use
              grep -E "(java|openjdk) version" |

      but parsing the output of java -version is always going to be a potential source of bugs.
      Perhaps running the java executable and using standard system properties is more robust?

            Assignee:
            Jonathan Gibbons
            Reporter:
            Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: