Solve issues with Java for all IntelliJ based IDEs

See #4524 for details and reasons behind this solution which is upgrade-proof and will also work in case user has multiple Java installations.

The list of all IntelliJ IDEs (affected casks) can be obtained from http://www.jetbrains.com/products.html

There will be another PR for adding/correcting the Java caveats for all of these casks (all should support Java 6+ which also includes 8).

btw. I was not digging deeper for reason, but it would really help if `link` could be reused in the DSL as there's usually version present too.

I will welcome any feedback, especially from @zwaldowski @thesamet @alebelcor @ashishb @justmao945