Module: Language::Java

Defined in:
brew/Library/Homebrew/language/java.rb,
brew/Library/Homebrew/extend/os/mac/language/java.rb

Class Method Summary collapse

Class Method Details

.java_home(version = nil) ⇒ Object



10
11
12
13
14
15
# File 'brew/Library/Homebrew/language/java.rb', line 10

def self.java_home(version = nil)
  req = JavaRequirement.new [*version]
  raise UnsatisfiedRequirements, req.message unless req.satisfied?

  req.java_home
end

.java_home_cmd(version = nil) ⇒ Object

Raises:

  • (NotImplementedError)


5
6
7
8
# File 'brew/Library/Homebrew/language/java.rb', line 5

def self.java_home_cmd(_ = nil)
  # macOS provides /usr/libexec/java_home, but Linux does not.
  raise NotImplementedError
end

.java_home_env(version = nil) ⇒ Object



22
23
24
# File 'brew/Library/Homebrew/language/java.rb', line 22

def self.java_home_env(version = nil)
  { JAVA_HOME: java_home_shell(version) }
end

.overridable_java_home_env(version = nil) ⇒ Object



26
27
28
# File 'brew/Library/Homebrew/language/java.rb', line 26

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