/usr/libexec/java_home is specific to macOS.
Language::Java::java_home_cmd is not implemented on Linux and raises
NotImplementedError.
Add private Language::Java::java_home_shell and use it instead of java_home_cmd.
Add public Language::Java::java_home for use by formulae.
Adjust the rules based on the current codebase. Remove various enable,
disables and default values that are unnecessary. Add more comments
explaining why. Make minor changes needed to enable a few more rules.
The `cask` attribute doesn't make as much sense on Linux but can be
ignored there. The advantage of this change is that (like #4086) it
allows figuring out the relevant cask for a formulae requirement on a
Linux machine.
It's redirected to cleartext, though this URL will be opened
in a browser so it won't be something hidden, and maybe
Oracle will fix this in the future.
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.)
It made less sense to call a method `java_version` when it returns
boolean value.
ClosesHomebrew/homebrew#45501.
Signed-off-by: Xu Cheng <xucheng@me.com>
Dependency is another similar, related class and it's super confusing
to have some Requirements that are named *Dependency.
ClosesHomebrew/homebrew#38891.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>