Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-6659677

jtreg refuses to be run by openjdk

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • jtreg4.0
    • jtreg3.2.2_02
    • 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?

            jjg Jonathan Gibbons
            martin Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: