Added JavaDependency to requeriments

Following the suggestion of @dpo and @sjackman I'm proposing to add a `JavaDependency` in the Homebrew core requirements 

You can read more here https://github.com/Homebrew/homebrew-science/pull/1039

Currently it checks for Java 1.7 JDK. I would like to ask your help to define it as configurable parameter, so that it would be possible to specify which version of Java is required e.g. `1.7`, `1.7+`, `1.8`, etc.


 
Check out `python_dependency.rb`; would be good to have a similar approach here where you make a `JDKDependency` that checks for any JDK and then `JDK7Dependency` and `JDK8Dependency` that subclass it to handle those cases.