
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.)
20 lines
295 B
Ruby
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
|