how to check which java version code example
Example 1: check java version in cmd
java -version
Example 2: check Version of java
$ java -version
java version "1.8.0_121"
java -version
$ java -version
java version "1.8.0_121"