Module: Language::Java

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

Overview

Helper functions for Java formulae.

Class Method Summary collapse

Class Method Details

.java_home(version = nil) ⇒ Object


30
31
32
33
34
35
36
37
38
# File 'Library/Homebrew/language/java.rb', line 30

def self.java_home(version = nil)
  f = find_openjdk_formula(version)
  return f.opt_libexec if f

  req = JavaRequirement.new Array(version)
  raise UnsatisfiedRequirements, req.message unless req.satisfied?

  req.java_home
end

.java_home_env(version = nil) ⇒ Object


45
46
47
# File 'Library/Homebrew/language/java.rb', line 45

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

.overridable_java_home_env(version = nil) ⇒ Object


49
50
51
# File 'Library/Homebrew/language/java.rb', line 49

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