Unable to use Java 1.8
<p>I'm having trouble using eclipse/intelliJ because whenever I try to check java version, this is what I will get. But java is present in the system preferences pane. </p>

<pre><code>$ java -version
Unable to locate an executable at "/usr/libexec/java_home/bin/java" (-1)
</code></pre>