• t

    Tor Houghton

    2 months ago
    Does anyone have a good search example for finding a specific Java version? (or rather: "higher than a certain version")? Ref.
  • Katheryn Satterlee

    Katheryn Satterlee

    2 months ago
    I haven't been able to hunt one down yet, but I'm seeing what I can dig up.
    I've got this to check the JDK version on Mac:
    select path 
    from (
        select directory as path FROM file
        Where directory = "/Library/Java/JavaVirtualMachines" 
        AND  CAST(SUBSTR(filename, INSTR(filename, '-') +1, (INSTR(filename, '.') - 1) - INSTR(filename, '-')) as INT) >= 9
        union all
        select path from homebrew_packages 
        where name LIKE "%jdk%"
        AND CAST(version as INT) >= 9
    Which checks for both manual download/install and homebrew installations. Working on getting access to Win/Linux machines with JDK installed so that I can test those as well.
    It checks if JDK is installed with a version of 9 or later.