Module: Language::Java

Defined in:
Library/Homebrew/language/java.rb

Class Method Summary collapse

Class Method Details

.java_home_cmd(version = nil) ⇒ Object



3
4
5
6
# File 'Library/Homebrew/language/java.rb', line 3

def self.java_home_cmd(version = nil)
  version_flag = " --version #{version}" if version
  "/usr/libexec/java_home#{version_flag}"
end

.java_home_env(version = nil) ⇒ Object



8
9
10
# File 'Library/Homebrew/language/java.rb', line 8

def self.java_home_env(version = nil)
  { JAVA_HOME: "$(#{java_home_cmd(version)})" }
end

.overridable_java_home_env(version = nil) ⇒ Object



12
13
14
# File 'Library/Homebrew/language/java.rb', line 12

def self.overridable_java_home_env(version = nil)
  { JAVA_HOME: "${JAVA_HOME:-$(#{java_home_cmd(version)})}" }
end