Bob W. Hogg 5a214de68d java_requirement: port to Linux and refactor
Split the core requirement class into generic, Linux-specific,
and macOS-specific parts.

Additionally, the Linux version is now able to detect Java versions
(the previous Linuxbrew implementation was only able to detect
if Java was present at all.)
2017-02-15 21:35:26 -08:00

20 lines
295 B
Ruby

require "language/java"
class JavaRequirement < Requirement
default_formula "jdk"
env do
next unless @java_home
env_java_common
if (Pathname.new(@java_home)/"include").exist? # Oracle JVM
env_oracle_jdk
end
end
private
def oracle_java_os
:linux
end
end