how to know java version from cmd code example Example 1: check java version java --version Example 2: java version command java -version