diff --git a/doc/CASK_LANGUAGE_REFERENCE.md b/doc/CASK_LANGUAGE_REFERENCE.md index 81ffec8c605..478571ab8f9 100644 --- a/doc/CASK_LANGUAGE_REFERENCE.md +++ b/doc/CASK_LANGUAGE_REFERENCE.md @@ -219,7 +219,7 @@ The following methods may be called to generate standard warning messages: | --------------------------------- | ----------- | | `path_environment_variable(path)` | users should make sure `path` is in their `$PATH` environment variable | `zsh_path_helper(path)` | zsh users must take additional steps to make sure `path` is in their `$PATH` environment variable -| `depends_on_java(version)` | users should make sure they have the specified version of java installed (`version` should be one of `6`, `7`, or empty for `8`) +| `depends_on_java(version)` | users should make sure they have the specified version of java installed. `version` can be exact (e.g. `6`), a minimum (e.g. `7+`), or omitted (when any version works). | `logout` | users should log out and log back in to complete installation | `reboot` | users should reboot to complete installation | `files_in_usr_local` | the Cask installs files to `/usr/local`, which may confuse Homebrew diff --git a/lib/hbc/caveats.rb b/lib/hbc/caveats.rb index 578d1baddb7..0f2a0f669d5 100644 --- a/lib/hbc/caveats.rb +++ b/lib/hbc/caveats.rb @@ -77,13 +77,20 @@ class Hbc::CaveatsDSL end end - def depends_on_java(java_version = 'latest') - if java_version == 'latest' + def depends_on_java(java_version = 'any') + if java_version == 'any' puts <<-EOS.undent #{@cask} requires Java. You can install the latest version with brew cask install java + EOS + elsif java_version =~ /8/ || java_version =~ /\+/ + puts <<-EOS.undent + #{@cask} requires Java #{java_version}. You can install the latest version with + + brew cask install java + EOS else puts <<-EOS.undent