describe_java: Suppress stderr

Suppress the error message:
Unable to find any JVMs matching version "(null)".
This commit is contained in:
Shaun Jackman 2017-09-20 12:03:45 -07:00
parent 8bb57187ab
commit 2f6b8dcf68

View File

@ -134,7 +134,7 @@ class SystemConfig
# java_home doesn't exist on all macOSs; it might be missing on older versions. # java_home doesn't exist on all macOSs; it might be missing on older versions.
return "N/A" unless File.executable? "/usr/libexec/java_home" return "N/A" unless File.executable? "/usr/libexec/java_home"
java_xml = Utils.popen_read("/usr/libexec/java_home", "--xml", "--failfast") java_xml = Utils.popen_read("/usr/libexec/java_home", "--xml", "--failfast", err: :close)
return "N/A" unless $CHILD_STATUS.success? return "N/A" unless $CHILD_STATUS.success?
javas = [] javas = []
REXML::XPath.each(REXML::Document.new(java_xml), "//key[text()='JVMVersion']/following-sibling::string") do |item| REXML::XPath.each(REXML::Document.new(java_xml), "//key[text()='JVMVersion']/following-sibling::string") do |item|