• Mahmood Ali's avatar
    drivers/java: restore 0.8.7 java version detection (#5317) · 0fd2b457
    Mahmood Ali authored
    Restore 0.8.x behavior where java driver is marked as detected when
    `java -version` exits with 0 but returns unexpected output.
    
    Furthermore, we restore behavior when `java -version` where we parse the
    first three lines of `java -version` but ignore rest.
    
    If `java -version` returns less than 3 lines, Nomad 0.8.7 would panic.
    In this implementation, we'd still mark java as detected but returns
    empty version.
    
    The 0.8.7 logic for detecting java version is found in
    https://github.com/hashicorp/nomad/blob/v0.8.7/client/driver/java.go#L132-L172
    .
    
    I punt on revamping how we can be more resilient to java -version
    syntax, and aimed for preserving existing behavior instead.
    0fd2b457