Add support for java 11, the default in debian buster 10

This commit is contained in:
Jeroen Hooyberghs
2019-09-10 12:21:19 +02:00
parent 00c05a826f
commit 21d39590b0
7 changed files with 52 additions and 6 deletions

View File

@@ -24,7 +24,8 @@ Facter.add(:java_version) do
unless ['darwin'].include? Facter.value(:operatingsystem).downcase
version = nil
if Facter::Util::Resolution.which('java')
Facter::Util::Resolution.exec('java -Xmx12m -version 2>&1').lines.each { |line| version = $LAST_MATCH_INFO[1] if %r{^.+ version \"(.+)\"$} =~ line }
Facter::Util::Resolution.exec('java -Xmx12m -version 2>&1').lines.each { |line| version = $LAST_MATCH_INFO[1] if %r{^.+ version \"(.+)\".*$} =~ line }
end
version
end