Bash command to check if Oracle or OpenJDK java version is installed on Linux
<p>I need a bash line to check if java version currently installed is Oracle's or OpenJDK.</p>

<p>A one-liner by parsing the output of the <code>java -version</code> command:</p>

<pre><code>java -version
</code></pre>

<p>java Oracle output:</p>

<pre><code>java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
</code></pre>

<p>java OpenJDK Output:</p>

<pre><code>java version "1.7.0_91"
OpenJDK Runtime Environment (amzn-2.6.2.2.63.amzn1-x86_64 u91-b00)
OpenJDK 64-Bit Server VM (build 24.91-b01, mixed mode)
</code></pre>